Visual Studio 2008转Visual Studio 2010的模板问题

  将Visual Studio 2008的C++工程用Visual Studio 2010打开编译,如果出现了这个问题:

error C2252: an explicit instantiation of a template can only occur at namespace scope

  恭喜你,你中彩了~

  这句话是告诉你,不可以在一个类或函数中实例化一个模板,

解决方法:

  将这个模板的实例化扔到类或函数外面(也就是裸露在命名空间中)。

neonlight <[email protected]>,BLOG:http://blog.csdn.net/neonlight 转载请注明出处,谢谢!2010-08-04

猜你喜欢

转载自blog.csdn.net/neonlight/article/details/5976506