I would like to have a class that has a constructor which takes a variadic number of arguements and fills an array with it by unpacking somehow to a comma initializer list which is supported by the array, here the example:
class A{
public:
template<typename ...T>
A(T ... values): arr(sizeof...(T)) {
//convert the values somehow that the parameter pack is expanded in the comma initialized list as the following:
//arr << values1, values2, values3,... , valuesN
}
ArrayType arr;
}
This comma initialization method is especially the case for ArrayType beeing a Eigen::Matrix class ( arr << 1,2,3;
). I was wondering if the following is doable and if there is some other elegant way to fill the array in the case we can use the index operator (i) to the i-th element :-)
Thanks alot :)