Sign in to follow this  

Template nightmare... [SOLVED]

This topic is 4547 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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

This topic is 4547 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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