I have the following structure:
class Base {
virtual T foo() = 0;
};
class Derived : public Base {
T foo() override { /**/ }
}
class Derived1 : public Base {
T foo() override { /**/ }
}
I need the following to work (or an adequate substitute):
some_container<unique_ptr<Base>> objects;
Basically,
C++ AMP doesn't allow for virtual functions in kernels, but I definitely need an inheritance chain-like container behaviour.
What is a recommended / common pattern to transform this sort of inheritance chain to template magic?