Skip to main content
gamedev.net
🔒 Locked

external template classes?

Started by lack o comments Jan 15, 2005 at 12:16 PM 0 replies 350+ views
Original Post
lack o comments
lack o comments
Is there a way to declare a template class externally. I have come across a situation where two such classes use the other as a method parameter, and the only way I can think of doing it is with some kind of external declaration.

template<typename TYPE> class FOO
     {
     bool operator =(const BLAH<TYPE>&); //error, BLAH not yet declared 
     };

template<typename TYPE> class BLAH
     {
     bool operator =(const FOO<TYPE>&); //everything is fine here
     };
As usual, thanks in advance.
Extrarius
Extrarius
I'm not sure if the following would work, but I think it should:
template<typename TYPE> class BLAH;template<typename TYPE> class FOO{     bool operator =(const BLAH<TYPE>&); //error, BLAH not yet declared };template<typename TYPE> class BLAH{     bool operator =(const FOO<TYPE>&); //everything is fine here};
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.