Here is my situation:
Base class, no templated type:
struct Thing
{
} ;
Templated class, extends that very base class
template <typename T> struct VertexWriter : public Thing
{
template <typename S>
bool intersects( S* otherThing )
{
// has a body, returns T or F
}
} ;
Derived class, CONCRETE type (no template)
struct Rocket : VertexWriter<VertexPNCT>
{
template <typename S>
bool intersects( S* otherThing ) ; // WANTS TO OVERRIDE
// implementation in VertexWriter<T>
} ;
But template typename<S> bool VertexWriter<T>::intersects
cannot be marked virtual, because it is a template class.
There are many classes that derive from the VertexWriter<VertexPNCT>
specialization, so template specializing VertexWriter<VertexPNCT>
would not work.
So the normal thing to do is to provide a template specialization.
But Rocket
specifies it is a VertexWriter<VertexPNCT>
, so it is no longer a template class. Can it specialize OR override intersects
as if it were a virtual function?