C++20 features: new attributes, deprecate implicit capture of this, and classes in non-type template parameters.

This commit is contained in:
Anthony Calandra
2020-01-31 23:16:05 -05:00
parent 2e754375fd
commit 71c24af74f
3 changed files with 104 additions and 4 deletions

View File

@@ -17,7 +17,7 @@ C++17 includes the following new language features:
- [constexpr if](#constexpr-if)
- [utf-8 character literals](#utf-8-character-literals)
- [direct-list-initialization of enums](#direct-list-initialization-of-enums)
- [new standard attributes](#new-standard-attributes)
- [fallthrough, nodiscard, maybe_unused attributes](#fallthrough-nodiscard-maybe_unused-attributes)
C++17 includes the following new library features:
- [std::variant](#stdvariant)
@@ -260,7 +260,7 @@ byte d = byte{1}; // OK
byte e = byte{256}; // ERROR
```
### New standard attributes
### fallthrough, nodiscard, maybe_unused attributes
C++17 introduces three new attributes: `[[fallthrough]]`, `[[nodiscard]]` and `[[maybe_unused]]`.
* `[[fallthrough]]` indicates to the compiler that falling through in a switch statement is intended behavior.
```c++