I would like to make the API more flexible for example to use xt::xtensor_fixed<double, xt::xshape<3, 3>>. Is there a way to use SFINAE to overload based on rank, such that I can allow a very generic template?
This is going to be really cumbersome. Another solution would be to add a rank property to the different classes of xtensor, so the testing function can work for any kind of expression:
Thanks @JohanMabille ! The latter would be a really nice solution for me, and I guess something that could be beneficial for others. Could be a great extension for the next release. I will submit a PR today or tomorrow that we can iterate on.
Activity
JohanMabille commented on Sep 6, 2020
You can rely on SFINAE but you'll have to specialize the "testing" function for different types. For instance:
This is going to be really cumbersome. Another solution would be to add a rank property to the different classes of xtensor, so the testing function can work for any kind of expression:
tdegeus commented on Sep 7, 2020
Thanks @JohanMabille ! The latter would be a really nice solution for me, and I guess something that could be beneficial for others. Could be a great extension for the next release. I will submit a PR today or tomorrow that we can iterate on.
tdegeus commented on Sep 7, 2020
@JohanMabille What would you say that E::rank should be for xarray? Or should there be a second variable: has_fixed_rank?
JohanMabille commented on Sep 7, 2020
I think we could use SIZE_MAX for a dynamic rank.