xtensor icon indicating copy to clipboard operation
xtensor copied to clipboard

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

Open wolfv opened this issue 7 years ago • 2 comments

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 avatar Apr 29 '18 10:04 wolfv

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

wolfv avatar Apr 29 '18 10:04 wolfv

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

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

wolfv avatar Apr 29 '18 10:04 wolfv