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
auto a = mpp::as_arr(std::vector<int>{1, 2, 3});
std::cout << mpp::unwrap(a)[1] << std::endl;
Output is... 21852! And valgrind writes about invalid access to deallocated memory.
The reason is storing object as T&& in our wrappers. But T&& is also a reference (which is definitely going to be expired), so we should store passed rvalue object by value (T).
All the places handling both lvalue and rvalue objects should be revised.
The text was updated successfully, but these errors were encountered:
Consider a simple snippet:
Output is...
21852
! And valgrind writes about invalid access to deallocated memory.The reason is storing object as
T&&
in our wrappers. ButT&&
is also a reference (which is definitely going to be expired), so we should store passed rvalue object by value (T
).All the places handling both lvalue and rvalue objects should be revised.
The text was updated successfully, but these errors were encountered: