M
Miguel Guedes
Hello,
I have template class definition like so:
template <typename Type>
class Foo
{
.
:
.
template <typename SubType> Type* create();
template <typename SubType, typename Param1> Type* create();
template <typename SubType, typename Param1, typename Param2> Type* create();
.
:
.
};
The aim is to allow Foo::create to instantiate any (Type) class and let it
construct it with either no construction parameters, one or two.
Is there any way these three methods can be somehow simplified into one while
keeping the same functionality?
I have template class definition like so:
template <typename Type>
class Foo
{
.
:
.
template <typename SubType> Type* create();
template <typename SubType, typename Param1> Type* create();
template <typename SubType, typename Param1, typename Param2> Type* create();
.
:
.
};
The aim is to allow Foo::create to instantiate any (Type) class and let it
construct it with either no construction parameters, one or two.
Is there any way these three methods can be somehow simplified into one while
keeping the same functionality?