4 ms·
RVO is flawed because the compiler may(!) elide function calls. The compiler cannot know if those function calls are semantically superfluous or not. 'move' is
by ExpiredLink 11y ago
RVO is flawed because the compiler may(!) elide function calls. The compiler cannot know if those function calls are semantically superfluous or not.
'move' is flawed because if blurs the object id == object address equality inherited from C.
Both, RVO and 'move' are workarounds for language deficits - workarounds gone wrong.
- TheCoelacanth 11y agoA copy constructor that cannot be elided is a broken copy constructor.
- ExpiredLink 11y agoThis may be true for simple structs but is definitely wrong as a general statement. Compilers cannot anticipate semantics.
- TheCoelacanth 11y agoIt is true for all copy constructors in C++ since the standard allows compilers to perform copy elision.