Could a object be moved if this is no `copy constructor` for the class?

Viewed 80

Could a object be moved if this is no copy constructor for the class?In another word, is it legal that a class has move constructor whereas its copy constructor is marked as deleted.If it's ok, does it go againt the rule of three, rule of five?

1 Answers

Yes it's perfectly legal.

Think about e.g. std::unique_ptr, which is indeed movable but not copyable.

Related