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

Investigate if we can use std::placeholders for xshape creation #829

Open
wolfv opened this issue Apr 29, 2018 · 2 comments
Open

Investigate if we can use std::placeholders for xshape creation #829

wolfv opened this issue Apr 29, 2018 · 2 comments
Labels

Comments

@wolfv
Copy link
Member

wolfv commented Apr 29, 2018

Maybe it's possible to do an empty implementation like the following:

empty<double>({_3, _2, _5});

by using compile time integer placeholders (http://en.cppreference.com/w/cpp/utility/functional/placeholders)

Or if that doesn't work, we could also think about allowing the following with an Args... overload.
This would require a bunch of annoying std::enable_if's though.

empty<double>(_3, _2, _5); // ==> xfixed<..., <3, 2, 5>>
// and
empty<double>(3, 1, 5); // ==> xtensor<..., 3>
@wolfv
Copy link
Member Author

wolfv commented Apr 29, 2018

seems like the only way to do it is an Args... overload.

@wolfv
Copy link
Member Author

wolfv commented Apr 29, 2018

screenshot from 2018-04-29 12-58-27

Works in C++ 17! maybe we need to add some features for C++ 17 users slowly ... :)

@tdegeus tdegeus added the C++17 label Dec 4, 2023
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

2 participants