Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

templates and inheritance.

Status
Not open for further replies.

konbollen

Programmer
Jan 3, 2002
2
US
Hello I have the following problem.

1. I have the following template class.
template<typename T> class Array
{
};

2. I have another template class that inherits from Array
template<typename T> class OpenGlVertexArray : public Array<T>
{
public:
virtual OpenGlVertexArray<T>* to_2d(void) const=0;
virtual OpenGlVertexArray<T>* to_3d(void) const=0;
// more code.
}

3. The third class inherites from OpenGlVertexArray
template<typename T> class OpenGlVertexArray2D : public OpenGlVertexArray< OpenGlVertex2D<T> >
{
public:
virtual OpenGlVertexArray<T>* to_2d(void) const;
virtual OpenGlVertexArray<T>* to_3d(void) const;
};

after providing the implemintation for both functions I get compiler errors and some times linker errors.
The errors I get are usually
C2555 type.
and some unresolved symbols.
How can I fix this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top