-
Notifications
You must be signed in to change notification settings - Fork 426
Open
Labels
Description
The resize
function currently discards all container values (except if the expected size is equal to the current size): this is a major difference with the STL containers behavior.
Example:
xtensor<int, 1> a{0, 1, 2, 3, 4};
a.resize({4});
std::cout << a; // undefined behavior
IMHO an STL compliant API which limits surprises would be better (perhaps with an extra option to disable data copying). This should also be described in the documentation (I maybe missed it).