W
wbasheer
Hi,
Can anyone please tell me why this code is giving me a C2327 error? I
am using Visual C++ 2008.
template<class T, int T::*IntMemberOfT>
class Foo
{
};
class Bar
{
public:
int memberOfBar;
typedef Foo<Bar, &Bar::memberOfBar> TypeDefedFooBar;
};
The errors I see are:
error C2327: 'Bar::memberOfBar' : is not a type name, static, or
enumerator => Why am I seeing this one?
error C2065: 'memberOfBar' : undeclared identifier => This one will
probably go away once C2327 is gone.
If I move the type definition outside of Bar's scope it compiles
successfully.
Thanks
Waseem
Can anyone please tell me why this code is giving me a C2327 error? I
am using Visual C++ 2008.
template<class T, int T::*IntMemberOfT>
class Foo
{
};
class Bar
{
public:
int memberOfBar;
typedef Foo<Bar, &Bar::memberOfBar> TypeDefedFooBar;
};
The errors I see are:
error C2327: 'Bar::memberOfBar' : is not a type name, static, or
enumerator => Why am I seeing this one?
error C2065: 'memberOfBar' : undeclared identifier => This one will
probably go away once C2327 is gone.
If I move the type definition outside of Bar's scope it compiles
successfully.
Thanks
Waseem