Implicit Move Suppression
A class defines a custom copy constructor and copy assignment operator but does not declare any move operations. What happens when you attempt to move an instance of this class?
class Widget {
public:
Widget() = default;
Widget(const Widget&) { /* custom copy */ }
Widget& operator=(const Widget&) { /* custom copy assign */ }
};
Widget a;
Widget b = std::move(a);
Sign in to answer questions and track your progress
Sign In