Jump to content
  • Advertisement
Sign in to follow this  
Thaligar

Template nightmare... [SOLVED]

This topic is 4797 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
Advertisement
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
a big bow ;)

thanks, awesome fast,
only this little braces,
now i fell some kind of dump

thx to "Fruny" and "SiCrane"

greets
tgar

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!