您的位置:首页 > 编程语言 > C语言/C++

C++备忘录057:notes of "Back to The Basics! Essentials of Modern C++ Style"

2020-01-13 17:10 288 查看

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&&
的问题

  • 点赞
  • 收藏
  • 分享
  • 文章举报
mo.xiaoming 发布了67 篇原创文章 · 获赞 0 · 访问量 430 私信 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: