I am making some simple objects for file I/O. I want one of the member functions to be templated, but I also want it to be a pure virtual method, because the interface is defined in an abstract base class. Does anyone know how to do this? Thanks.
I am making some simple objects for file I/O. I want one of the member functions to be templated, but I also want it to be a pure virtual method, because the interface is defined in an abstract base class. Does anyone know how to do this? Thanks.
error C2898: 'void __thiscall Base::foo(T)' : member function templates cannot be virtualCode:class Base { public: template<class T> virtual void foo(T a) = 0; };
Looks like you are stuck with:
ggCode:template <class T> class Base { public: virtual void foo(T a) = 0; };
yeah, that's what I figured...just thought I'd check though. Thanks.