operator[]
can only take one argument, the easiest solution is to overload operator()
instead and access members via ()
instead of []
.
The proper syntax would then be:
template <class T>
template <class ... I>
T& MultiDimArray<T>::operator()(I ... i)
{
}
You were also using the types list I
as though they were parameter names instead of type names (which is fixed in my example).