Quantcast
Channel: User HolyBlackCat - Stack Overflow
Viewing all articles
Browse latest Browse all 1287

Answer by HolyBlackCat for Most concise way to disable copy and move semantics

$
0
0

It's enough to delete the copy operations, then the move operations will get removed automatically.


But if you're asking for "concise", according to this chart (by Howard Hinnant):

meow

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

Though, as I said above, I wouldn't use this in practice, and would instead delete the copy constructor and copy assignment.


Viewing all articles
Browse latest Browse all 1287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>