4 ms·
It's not as major of an update as previous releases, but there are a lot of little convenience features. String views, same-line nested namespaces, [[fallthrou
by mratzloff 9y ago
It's not as major of an update as previous releases, but there are a lot of little convenience features.
String views, same-line nested namespaces, [[fallthrough]], if with init (I'm sure Google single-handedly got this included; it's very Go-reminiscent and really nice when not using exceptions), structured bindings, maybes with std::optional (occasionally useful), and even just something as simple as emplace returning a reference.
What fixes do you think std::move needs, out of curiosity?
- cominous 9y agoIts not std::move, but the complexity coming with it. Its a hassle applying move semantics correctly and there is not the one goto solution for simple things. Im not aware of a proposal to change that issue, but at least there should be better defaults. This talk explains the pain quite well: https://www.youtube.com/watch?v=PNRju6_yn3o https://www.youtube.com/watch?v=PNRju6_yn3o
- repsilat 9y agoThe amount of prayer I have put into RVO and moves happening "right"... As someone who isn't a C++ programmer, is there anything better than looking at annotated asm? Templating everything and trying it with something that isn't copyable? (Actually, would that even work with RVO?)
- jcelerier 9y ago> As someone who isn't a C++ programmer, is there anything better than looking at annotated asm put a debug breakpoint in the move constructor and run your tests :p
- devinj 9y agostd::move should extend the lifetime of a temporary like static_cast does. (Or else not accept temporaries). Otherwise, no new features necessary. But that one bites sometimes.
- deleted 9y ago[deleted]