【发布时间】:2013-11-03 01:07:34
【问题描述】:
我在 Windows 上面临“错误 C2327”。
我减少了代码并在测试程序中遇到了类似的错误
#include <boost/intrusive/list.hpp>
#include <iostream>
class Test {
protected:
typedef Test self_type;
boost::intrusive::list_member_hook<> order_hook;
public:
typedef boost::intrusive::member_hook<self_type,
boost::intrusive::list_member_hook<>,
& Test::order_hook > order_hook_type;
};
这在 g++ 上运行良好,但在 Windows 上却出现以下错误:
test.cpp(11) : error C2327: 'Test::order_hook' : is not a type name, static, or enumerator
test.cpp(11) : error C2065: 'order_hook' : undeclared identifier
请帮忙。我在 Windows 中缺少什么?
【问题讨论】:
-
你用的是什么版本的VS?
-
Microsoft Visual Studio 2010 版本 10.0.40219.1 SP1Rel Microsoft .NET Framework 版本 4.0.30319 SP1Rel
-
嗯,当你把
order_hook_type放到课外就可以了…… -
@catscradle 那会是标准方式吗?为此,我必须将 order_hook 设为公开
-
现在让社区来决定,因为我没有任何线索。 :-)
标签: c++ windows visual-studio templates g++