Hello dear people of the underworld called the internet.
Lets say we have a class called X with the template parameters(Y):
template
c
X is not a type without its template argument so no, unfortunately not. You could achieve what you want if X had a base class which defined the interface you wanted to use though.
For example,
struct Interface
{
Interface() {}
virtual ~Interface(){}
virtual void doSomething() = 0;
};
template
class X : public Interface
{
//...
virtual void doSomething() override;
};
std::unique_ptr myClass;
//....
myClass.reset(new X());
myClass->doSomething();