You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It can make sense for users to move the data/storage out of an xcontainer (for instance statically reshape an xt::xtensor<T, N> to an xt::xtensor<T, 1>).
@AntoinePrv I thought I had replied and I just realized I didn't, sorry for that.
I think the signature should be the first one since the method will return a data member (which is not a rvalue, thus there a chance to have a copy if you use the second signature).
Motivation
It can make sense for users to move the data/storage out of an
xcontainer
(for instance statically reshape anxt::xtensor<T, N>
to anxt::xtensor<T, 1>
).Right now, we can do
But, as suggested by @JohanMabille, we cannot do
Or
Proposed Implementation
Add one of the following overload to
xcontainer
:- a/
storage_type&& storage() noexcept&&;
- b/
storage_type storage() noexcept&&;
I can send a PR for this.
The text was updated successfully, but these errors were encountered: