Last updated:2026-10-12
C++11 New Features Overview¶
1.C++11 New Features¶
-
Spaces in Template Expressions
vector<list<int> > //ok in each C++ version
vector<list<int>> // before c++ 11 error error: ‘>>’ should be ‘> >’ within a nested template argument list,c++11后可以正常通过
If you define a ctor yourself, the compiler will no longer give you a default ctor. By forcibly adding =default, you can regain and use the default ctor.
-
Alias Template (template typedef)
-
Containers - structure and classification
-
(1) Sequence containers include: array (newly introduced in C++2.0), vector, deque, list, forward_list (newly introduced in C++2.0)
- (2) Associative containers include: set/multiset, map/multimap
-
(3) Unordered containers (newly introduced in C++2.0, replacing the former hash_xxx with unordered_xxx) include: unordered_map/unordered_multimap, unordered_set/unordered_multiset
Learning material: https://www.bilibili.com/video/av51863195?from=search&seid=3610634846288253061
Related Topics¶
- How C++ std::move Works and How to Use It | C++那些事
- C++ std::bind vs lambda | C++那些事
- C++ Variadic Templates | C++那些事