Jump to content
  • Advertisement
Sign in to follow this  
smc

[C++] Class Template Member Template SOLVED

This topic is 3500 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

The call should be: et.buildTable<GLPointArray<GLPoint<GLint> >, GLint>(arr) ; That really looks nasty. I have built the following class. I can declare an instance of the class with no issues. However, all the different calling permutations i tried with the buildTable method do not work. How exactly would I call this method. I assumed it would be something like this: et.buildTable<GLPointList, GLint>(polygon) ;
template <typename T> 
class EdgeTable {
public:

    vector< list<T> >   edges ;

    template<typename ArrType, typename DataType>
    void buildTable( const ArrType& ) ;
     
    template<typename NodeType>
    void insertNode( NodeType& ) ;


} ;



btw... I using templates heavy just to see how far I can take it... and learn something along the way. [Edited by - smc on October 23, 2008 8:17:44 PM]

Share this post


Link to post
Share on other sites
Advertisement
What do you mean by 'do not work'? If it's a compiler error, can you post the error?

Share this post


Link to post
Share on other sites
I realize that you may have only provided a type declaration "stub" for convenience, but just in case...

In C++, if you use templates you must provide the implementation in the same file as the declaration. If you have buildTable defined in a different .cpp file, you are going to have problems.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!