Sign in to follow this  
Thaligar

Template nightmare... [SOLVED]

Recommended Posts

Thaligar    142
hey folks, now a really problem, if someone got an idea, post, post, post... well assume i've got a class template<class X> class K { struct J { X unknown; }; inline J * test( void ); }; so far so good now the implementation... template<X> inline (typename K<X>::J) * K<X>::test( vid ) { return; }; ok, for me it seems ok but the compiler means error C2226: unexpected type ( i think i have to write K<X>::J because the struct is internal and templated, probably there is an error) please help!!! thx in advance tgar [Edited by - Thaligar on July 1, 2005 1:32:00 PM]

Share this post


Link to post
Share on other sites
Fruny    1658
template<class X>
class K
{
struct J
{
X unknown;
};

public:
inline J * test( void );
};

template<typename X>
inline typename K<X>::J* K<X>::test( void )
{
return 0;
};

int main()
{
K<int> k;
k.test();
}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this