Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resize in TeamSpec is ambiguous in case of two dimensions #625

Open
dhinf opened this issue Jan 25, 2019 · 3 comments
Open

resize in TeamSpec is ambiguous in case of two dimensions #625

dhinf opened this issue Jan 25, 2019 · 3 comments
Assignees
Labels

Comments

@dhinf
Copy link
Member

dhinf commented Jan 25, 2019

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.

@dhinf
Copy link
Member Author

dhinf commented Jan 25, 2019

Maybe rename resize(dim_t...) to resize_dim(dim_t,...)

@devreal
Copy link
Member

devreal commented Jan 25, 2019

I'm fine with renaming resize(dim_t, SizeType) to resize_dim(...).

@fuchsto
Copy link
Member

fuchsto commented Mar 9, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants