- Modern C++ Programming Cookbook
- Marius Bancila
- 183字
- 2021-06-11 18:22:12
1 Learning Modern Core Language Features
The C++ language has gone through a major transformation in the past decade with the development and release of C++11 and then, later, with its newer versions: C++14, C++17, and C++20. These new standards have introduced new concepts, simplified and extended existing syntax and semantics, and overall transformed the way we write code. C++11 looks like a new language, and code written using the new standards is called modern C++ code.
The recipes included in this chapter are as follows:
- Using auto whenever possible
- Creating type aliases and alias templates
- Understanding uniform initialization
- Understanding the various forms of non-static member initialization
- Controlling and querying object alignment
- Using scoped enumerations
- Using override and final for virtual methods
- Using range-based for loops to iterate on a range
- Enabling range-based for loops for custom types
- Using explicit constructors and conversion operators to avoid implicit conversion
- Using unnamed namespaces instead of static globals
- Using inline namespaces for symbol versioning
- Using structured bindings to handle multi-return values
- Simplifying code with class template argument deduction
Let's start by learning about automatic type deduction.
推薦閱讀
- 少兒人工智能趣味入門:Scratch 3.0動畫與游戲編程
- Mastering ServiceStack
- C#程序設計(慕課版)
- Learning Elixir
- Learning FuelPHP for Effective PHP Development
- 智能手機APP UI設計與應用任務教程
- Building Serverless Architectures
- Laravel Application Development Blueprints
- Maven for Eclipse
- Python預測分析與機器學習
- Drupal 8 Development Cookbook(Second Edition)
- 快樂編程:青少年思維訓練
- C++17 By Example
- H5匠人手冊:霸屏H5實戰解密
- HTML5 Game Development by Example:Beginner's Guide(Second Edition)