4 ms·
You're right on the money. This passage is particularly damning: > Rvalue references encourage a programming style that makes heavier use of value semantics. T
by brianpgordon 13y ago
You're right on the money. This passage is particularly damning:
> Rvalue references encourage a programming style that makes heavier use of value semantics. This style is unfamiliar to many developers, and its performance characteristics can be hard to reason about.
It's like, do you know C++ or don't you? Value semantics are C++.
- fauigerzigerk 13y agoThey are right that it's harder to reason about value semantics. The cost of passing a pointer is always the same whereas the cost of passing a value isn't. But I don't think that's a good enough reason not to prefer values considering the performance and memory usage drawbacks of shared_ptr. unique_ptr is often the best solution in my view.