- 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.
推薦閱讀
- Java Web開發學習手冊
- Oracle從新手到高手
- Java Web基礎與實例教程(第2版·微課版)
- 軟件測試項目實戰之性能測試篇
- Web Application Development with R Using Shiny(Second Edition)
- Troubleshooting PostgreSQL
- C語言程序設計案例精粹
- SQL Server 2012數據庫管理與開發項目教程
- HTML5入門經典
- Python Data Analysis Cookbook
- Advanced Express Web Application Development
- Web前端應用開發技術
- Go語言開發實戰(慕課版)
- Android應用開發深入學習實錄
- Flink技術內幕:架構設計與實現原理