I would like to disable the move constructor in the class. Instead of moving, I would like to base on copy constructor. When I try to write this code:
class Boo
{
public:
Boo(){}
Boo(const Boo& boo) {};
Boo(Boo&& boo) = delete;
};
Boo TakeBoo()
{
Boo b;
return b;
}
during compilation I received error:
error C2280: 'Boo::Boo(Boo &&)': attempting to reference a deleted function
How can I disable the move constructor and force copies instead?