I have the following template method declared in my interface:
class IObjectFactory
{
public:
virtual ~IObjectFactory() { }
virtual int32_t Init() = 0;
virtual bool Destroy() = 0;
virtual bool Start() = 0;
virtual bool Stop() = 0;
virtual bool isRunning() = 0;
virtual void Tick() = 0;
template <class T>
Object<T> CreateObject(T);
};
I am not sure how the call looks like though. I thought the following would be enough, where mObjFactory is an implementation of previously mentioned virtual class;
inline void AllocateWithMemPoolAux() { mObjFactory->CreateObject<TestClass1>(); }
The error I get is “No instance of function template matches the argument list”
What does the proper function call look like?
(also – as a sidenote, is it okay to declare a template method in an interface and demand the user implement it? as you cannot declare it virtual)
Thanks
notice:
did you mean
?