Reputation: 756
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?
Upvotes: 2
Views: 248
Reputation: 409482
Yes it's perfectly legal.
Think about e.g. std::unique_ptr
, which is indeed movable but not copyable.
Upvotes: 7