I have a simple yet daunting problem I can\'t solve by myself. I have something like
template
T* create(SomeCastableType* args,
You need a helper:
#include
template
struct helper
{
static T * go(S * args)
{
return helper::value,
Tuple, I..., sizeof...(I)>::go(args);
}
};
template
struct helper, I...>
{
static T * go(S * args)
{
return new T(static_cast(args[I])...);
}
};
template
T * create(S * args)
{
return helper>::go(args);
}
Edit: Tested, seems to work.