• Advertisement
Sign in to follow this  

[C++] Class Template Member Template SOLVED

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