C++备忘录057:notes of "Back to The Basics! Essentials of Modern C++ Style"
CppCon 2014: Herb Sutter “Back to the Basics! Essentials of Modern C++ Style”
一如既往,值得听好几遍的演讲,除了那段perfect forwarding代码似乎有bug
- Write for clarity and correctness first.
- Avoid premature optimization. By default, prefer clear over optimal.
- Avoid premature pessimization, prefer faster when equally clear.
这里似乎没法接受std::string
作为参数,!std::is_same
应该是std::is_constructible
或者std::is_convertible
吧
我犯过本地变量用auto&&
的问题