#include <initializer_list>
template <class T> class test {
private
T* arr[][2];
unsignedint rows;
unsignedint cols;
public
test<T>(//What to write here??);
};
test<T>::test(//What to write here??) {
//rows = sizeof...(T); problem is i need the rows und cols
// i found this sizeof...(T) if i wanted to use variadic templates, but i have no clue how
// i also tried using initializer_list but then i need something,
//like (initializer_list< initializer_list<T> > args) ??
}
int main() {
test<int> {{1,2},{3,4}}; // should be the input
}
As stated in the code i tried different kind of initializing but i'm not sure how to do it the best way and also i could not get it to work properly. Would be very nice if someone could enlighten me.
The problem is this is a minimal example. I cannot use vector because the class is in a much larger bib i need to use and i cannot change the whole thing just to use vectors. :/ It would be so much easier.