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.

C++备忘录057:notes of "Back to The Basics! Essentials of Modern C++ Style"
C++备忘录057:notes of "Back to The Basics! Essentials of Modern C++ Style"
C++备忘录057:notes of "Back to The Basics! Essentials of Modern C++ Style"
C++备忘录057:notes of "Back to The Basics! Essentials of Modern C++ Style"
C++备忘录057:notes of "Back to The Basics! Essentials of Modern C++ Style"
C++备忘录057:notes of "Back to The Basics! Essentials of Modern C++ Style"
C++备忘录057:notes of "Back to The Basics! Essentials of Modern C++ Style"
C++备忘录057:notes of "Back to The Basics! Essentials of Modern C++ Style"
C++备忘录057:notes of "Back to The Basics! Essentials of Modern C++ Style"
C++备忘录057:notes of "Back to The Basics! Essentials of Modern C++ Style"
这里似乎没法接受std::string作为参数,!std::is_same应该是std::is_constructible或者std::is_convertible

C++备忘录057:notes of "Back to The Basics! Essentials of Modern C++ Style"
C++备忘录057:notes of "Back to The Basics! Essentials of Modern C++ Style"
我犯过本地变量用auto&&的问题