我在最近的一个项目中,曾想给CList模板类实现赋值操作符的特化,遇到了一个问题。就是c++编译器会崩溃,并报如下错误:
fatal error C1001: An internal error has occurred in the compiler.
1>(compiler file 'msc1.cpp', line 1393)
1> To work around this problem, try simplifying or changing the program near the locations listed above.
1>Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
源代码:
template<>
{
return rhs;
}
我在vc 2005 sp1 / 2008 sp1上测试,结果一致,c++编译器崩溃!