Sign in to follow this  

[C++] Class Template Member Template SOLVED

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 {

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

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