Здравствуйте, Chez, Вы писали:
// type_of() evil implementation for VC7
. . .
Если написать в VC71:
type_of(std::make_pair(1, 3.14)) y = std::make_pair(1, 3.14);
компилятор жалуется:
------ Build started: Project: type_of, Configuration: Debug Win32 ------
Compiling...
main.cpp
c:\ark\type_of\main.cpp(123) : error C2668: 'VarTypeID' : ambiguous call to overloaded function
c:\ark\type_of\main.cpp(77): could be 'sized<NSize> VarTypeID<std::pair<_Ty1,_Ty2>>(const T &)'
with
[
NSize=7,
_Ty1=int,
_Ty2=double,
T=std::pair<int,double>
]
c:\ark\type_of\main.cpp(79): or 'sized<NSize> VarTypeID<std::pair<_Ty1,_Ty2>>(volatile T &)'
with
[
NSize=6,
_Ty1=int,
_Ty2=double,
T=std::pair<int,double>
]
while trying to match the argument list '(std::pair<_Ty1,_Ty2>)'
with
[
_Ty1=int,
_Ty2=double
]
c:\ark\type_of\main.cpp(123) : error C2955: 'CTypeRegRoot' : use of class template requires template argument list
c:\ark\type_of\main.cpp(19) : see declaration of 'CTypeRegRoot'
c:\ark\type_of\main.cpp(123) : error C2955: 'CTypeRegRoot' : use of class template requires template argument list
c:\ark\type_of\main.cpp(19) : see declaration of 'CTypeRegRoot'
Аркадий