Marking the function as =delete makes the function available for overload resolution, but if selected, compilation fails; this functionality is not limited to designers and other special functions (see here) . Previously (around C ++ 03), which made it private, achieved a similar result.
Therefore, the code, as in the example, actually means that you prohibit the construction of a class object from a temporary or expiring value (rvalues) - a constructor for moving.
To fix this, completely remove the move constructor. In the case of a class where the copy constructor is present (user-defined), the movement is not implicitly generated in any case (movement of the constructor and movement destination operator).
class Boo { public: Boo(){} Boo(const Boo& boo) {};
Niall
source share