- 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.
推薦閱讀
- 數據科學實戰手冊(R+Python)
- C++案例趣學
- jQuery Mobile Web Development Essentials(Third Edition)
- Building a Game with Unity and Blender
- Maven Build Customization
- Python語言程序設計
- Python爬蟲開發與項目實戰
- Python數據可視化之Matplotlib與Pyecharts實戰
- 小程序開發原理與實戰
- Python編程從0到1(視頻教學版)
- Learning Concurrent Programming in Scala
- 編程與類型系統
- 圖數據庫實戰
- Python 3 數據分析與機器學習實戰
- 編程改變生活:用Python提升你的能力(進階篇·微課視頻版)