标准和新特性 | 解释 |
C++11 | |
11.1 Automatic Type Deduction | auto |
11.2 Range-based Loops | for(auto el:range) |
11.3 Initializer Lists | {} |
11.4 Move Semantics | move |
11.5 Lambda Expressions | [](){} |
11.6 The constexpr Specifier | constexpr |
11.7 Scoped Enumerators | enum class |
11.8 Smart Pointers | unique_ptr |
11.9 std::unordered_set | unordered_set |
11.10 std::unordered_map | unordered_map |
11.11 std::tuple | pair->tuple |
11.12 static_assert | constexpr |
11.13 Introduction to Concurrency | thread(func) |
11.14 Deleted and Defaulted Functions | default |
11.15 Type Aliases
|
using id = type |
C++14 | |
14.1 Binary Literals | 0b1010 |
14.2 Digits Separators | 123'456 |
14.3 Auto for Functions | auto func(); |
14.4 Generic Lambdas | auto lambdas |
14.5 std::make_unique | make_unique() |
C++17 | |
17.1 Nested Namespaces | n::m::p declaration |
17.2 Constexpr Lambdas | Constexpr Lambdas |
17.3 Structured Bindings | auto[] = arr |
17.4 std::filesystem | filesystem |
17.5 std::string_view | non-owning view |
17.6 std::any | any c = 123; |
17.7 std::variant | union |
C++20 | |
20.1 Modules | export and import |
20.2 Concepts | template type requires |
20.3 Lambda Templates | []<>(){} |
20.4 [likely] and [unlikely] Attributes | if (choice) [[likely]] |
20.5 Ranges | ranges::sort(vec); |
20.6 Coroutines | co_await |
20.7 std::span | span<int> is = vec; |
20.8 Mathematical Constants | numbers::log2e |
ref | |
Modern C++ for Absolute Beginners |