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

Answer by HolyBlackCat for Is this understanding correct: If an object stores everything in itself, copying it and moving it is actually the same thing?

$
0
0

At least in C++, this is usually true for classes without design mistakes. But since you can have arbitrary code in copy/move constructors/assignments, it can't be true for arbitrary classes.

One exception I can think of (where this isn't true and this isn't a design mistake) is resetting moved-from members to some default values.


Viewing all articles
Browse latest Browse all 1332

Trending Articles



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