- 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.
推薦閱讀
- TypeScript Essentials
- Android Jetpack開發:原理解析與應用實戰
- 算法精粹:經典計算機科學問題的Java實現
- 軟件測試技術指南
- Java程序設計
- Principles of Strategic Data Science
- 區塊鏈架構之美:從比特幣、以太坊、超級賬本看區塊鏈架構設計
- C語言程序設計
- Appcelerator Titanium:Patterns and Best Practices
- Getting Started with Electronic Projects
- 企業級Java現代化:寫給開發者的云原生簡明指南
- Swift 2 Design Patterns
- Learning iOS Penetration Testing
- HTML5+CSS3+jQuery Mobile+Bootstrap開發APP從入門到精通(視頻教學版)
- C語言進階:重點、難點與疑點解析