Template within template: why “`>>' should be `> >' within a nested template argument list” 解决方法

如果直接这样写:

std::vector<boost::shared_ptr<int>> intvec;

gcc编译器会把">>"当成operator,报错:boost vector  error: ‘>>’ should be ‘> >’ within a nested template argument list

 

正确做法是加上空格:

std::vector<boost::shared_ptr<int> > intvec;

 

不过VS2010测试下不加空格也可以的。

posted @ 2013-08-11 16:16  Monn  阅读(3536)  评论(0编辑  收藏  举报