Is C++26 getting destructive move semantics?
Can I express a function that consumes an object? Meaning that its destructor is not run on the moved-from object? Like the proposed library function trivially_relocate_at itself? template <class T> T* trivially_relocate_at(T* dst, T* src); Naively, if the library authors can, so should I. Problem: Where is the magic sauce? That function signature does not convey that it effectively destructs an object at src, or the reverse problem, that it effectively constructs an object at dst. I suspect the answer is no: The few examples I have found are avoiding it by doing manual memory management with
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.