In several places I\'ve seen the recommended signatures of copy and move constructors given as:
struct T
{
T();
T(const T& other);
T(T&&a
It should be a non-const
rvalue reference.
If an object is placed in read-only memory, you can't steal resources from it, even if its formal lifetime is ending shortly. Objects created as const
in C++ are allowed to live in read-only memory (using const_cast
to try to change them results in undefined behavior).