Quick Q: Most concise way to disable copy and move semantics

Save to:
Instapaper Pocket Readability

Quick A: Delete the move assignment.

Recently on SO:

Most concise way to disable copy and move semantics

According to this chart (by Howard Hinnant):

The most concise way is to =delete move assignment operator (or move constructor, but it can cause problems mentioned in comments).

Though, in my opinion the most readable way is to =delete both copy constructor and copy assignment operator.

Add a Comment

You must sign in or register to add a comment.

Comments (0)

There are currently no comments on this entry.