Giter Club home page Giter Club logo

effective-modern-cpp's Introduction

  • Modern C++ 一般指 C++11 及其之后的标准,已在工业界被广泛应用。 C++ 初学者适合从 C++ Primer 开始学习 Modern C++ 的基本语法,通过 Effective C++ 掌握 C++98 的最佳实践,通过 Effective STL 掌握 STL 的正确使用,通过 Effective Modern C++ 掌握 C++11/14 的最佳实践,至此即可避开语言缺陷,得心应手地发挥 C++ 的长处。此为个人笔记,还将补充 C++17 相关特性。
  • 01 模板类型推断机制
  • 02 auto 类型推断机制
  • 03 decltype
  • 04 查看推断类型的方法
  • 05 用 auto 替代显式类型声明
  • 06 auto 推断出非预期类型时,先强制转换出预期类型
  • 23 std::movestd::forward 只是一种强制类型转换
  • 24 转发引用与右值引用的区别
  • 25 对右值引用使用 std::move,对转发引用使用 std::forward
  • 26 避免重载使用转发引用的函数
  • 27 重载转发引用的替代方案
  • 28 引用折叠
  • 29 移动不比拷贝快的情况
  • 30 无法完美转发的类型
  • 31 捕获的潜在问题
  • 32 用初始化捕获将对象移入闭包
  • 33 用 decltype 获取 auto&& 参数类型以 std::forward
  • 34 用 lambda 替代 std::bind
  • 41 对于可拷贝的形参,如果移动成本低且一定会被拷贝则考虑传值
  • 42 用 emplace 操作替代 insert 操作

effective-modern-cpp's People

Contributors

downdemo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.