dash
dash copied to clipboard
resize in TeamSpec is ambiguous in case of two dimensions
The method resize (TeamSpec) is ambiguous in case of two dimensions:
template<typename... Args> void resize(SizeType arg, Args... args) vs. void resize(dim_t dim, SizeType extent)
e.g. the call teamspec.resize(2,1) doesn't compile. Currently, I don't have a solution, in case we want to keep both functionalities.
Maybe rename resize(dim_t...) to resize_dim(dim_t,...)
I'm fine with renaming resize(dim_t, SizeType)
to resize_dim(...)
.
It should be:
resize(dim_t, d, SizeType extent);
resize(std::initializer_list<SizeType> extents);
The reason using the same name (overload) was the 1-dimensional case in particular.
TeamSpec<1> ts(16);
ts.resize(0, // Elementary, dear Watson!
8);
Another thing: We might also want resize<dim_t>(SizeType>
to ensure compile-time definition of the dimension. Nowadays, constexpr
achieves the same when used correctly, but it doesn't complain if we don't.