On 3/27/07, Scott Meyers
Given some base class,
class Base { virtual ~Base(){} };
I want to be able to implement this:
template<typename Seq> const Base& createObject() { // return an object that inherits from Base and every type in Seq }
The problem is how to create the type of object I want.
Thanks,
Scott
I'm probably won't use the correct mpl-isms, but something like
template <typename Seq>
struct inherit_all
{
struct type
:
public virtual first<Seq>::type,
public virtual inherit_all
template<typename Seq> const Base& createObject() { // return an object that inherits from Base and every type in Seq return new Base_and_Seq<Seq>(); }
Does any of that work, or at least head in the right direction? Or am I just recreating what inherit_linearly, etc already does? Tony