I want to write a wrapper function to which I can pass constructor initialization parameters for some class object. This wrapper will then use this list and pass on to constructor while defining a new object of that class. Not sure what STL or any other data type to use for this purpose. Basically in below code what data type should be used for argument_list. Any library which can assist?
Some code for perspective
class abc{
int a_;
char b_;
public:
abc(int a, char b)
:a_(a), b_(b)
{
}
}
// Wrapper
template <typename T>
void create_object_wrapper(argument_list list) // assuming argument_list can
//hold the parameters as
//intended
{
abc v1(list); //The use case I want
}
int main()
{
create_object_wrapper(1,'a'); // initialize object with (1, 'a')
return 0;
}
Thanks in advance.