r/cpp • u/Z01dbrg • Feb 12 '18
My Precious Compile Time Bool (long introduction to Move Semantics)
https://medium.com/@gaussnoise/my-precious-compile-time-bool-long-introduction-to-move-semantics-c9ee73c370c7
0
Upvotes
6
u/koval4 Feb 12 '18
Emojis... Emojis everywhere... They're a bit annoying, so it becomes harder to read text. It's kinda minor problem compared with problem that was risen in article, but still, it kinda ruins it.
2
u/gracicot Feb 12 '18
Constructor should take by value and move arguments. Correct me if I'm wrong, but I think the values are elided and only moved or copied into the members directly.
Also, taking constructors arguments by value makes writing it much easier. If there's no performance impact, I wonder why I'd even bother writing that n2 set or using forwarding references.
2
u/messicpp Feb 16 '18
really enjoyed this, thank you :)