error C2327: not a type name, static, or enumerator

I am facing "error C2327" on windows.
I reduced my code and get similar error with test program

1
2
3
4
5
6
7
8
9
10
11
12
#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;
};


This works fine on g++ but on windows it's giving following error:

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


Please help. What i am missing for windows?

Note: I am using Microsoft Visual Studio 2010 Version 10.0.40219.1 SP1Rel Microsoft .NET Framework Version 4.0.30319 SP1Rel
EDIT: Deleted my post, as I'm not familiar enough with boost::intrusive to be certain.
I'd say the problem is the typedef inside the class which is incomplete. Move the typedef outside the class. The member variable must be public. That's likely the price you have to pay for the intrusive approach
Topic archived. No new replies allowed.