2 ms·
Quite the opposite: move semantics are pervasive throughout the library and other idioms; making a lambda without copy is pretty canonical too (though if you're
by gumby 8y ago
Quite the opposite: move semantics are pervasive throughout the library and other idioms; making a lambda without copy is pretty canonical too (though if you're going to use it with locals after returning from the stack frame you'll inherently have to copy in any language!).
And it is very easy to write templates that use this behavior so users don't have to think of it. In C++20 the syntax for this will be very simple (less garish than the old <> syntax).
- notacoward 8y agoMaybe you've been working on different codebases than I have. Whatever might be in the libraries, what I see among the users of those libraries is a ton of careless copying. The idiom is what the majority do, not what some authority says they should do.