|
|
От: |
Ligen
|
http://zone-of-ambiguity.blogspot.com/ |
| Дата: | 26.05.10 11:40 | ||
| Оценка: | 69 (3) | ||
#include "string"
template<class Type, class ObjectType, template<class> class Traits, template<class> class AllocatorType>
void ToString(const ObjectType & object, std::basic_string<Type, Traits<Type>, AllocatorType<Type> > * pStr)
{
}
template<class Type, template<class> class Traits, template<class> class AllocatorType>
void ToString(int object, std::basic_string<Type, Traits<Type>, AllocatorType<Type> > * pStr)
{
}
int main()
{
int val = 0;
std::string str;
ToString(val, &str);
return 0;
}Самое прекрасное в этом баге то, что если поменять местами в первой функции Type и ObjectType местами, например, так:d:\Projects\test\main.cpp(17) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 2701)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
template<class ObjectType, class Type, template<class> class Traits, template<class> class AllocatorType>
void ToString(const ObjectType & object, std::basic_string<Type, Traits<Type>, AllocatorType<Type> > * pStr) ..