mirror of
https://github.com/AnthonyCalandra/modern-cpp-features.git
synced 2025-12-17 01:54:36 +03:00
Minor cosmetic changes: make attribute headers consistent; remove extra spacing in TOC.
This commit is contained in:
4
CPP17.md
4
CPP17.md
@@ -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)
|
||||
- [fallthrough, nodiscard, maybe_unused attributes](#fallthrough-nodiscard-maybe_unused-attributes)
|
||||
- [\[\[fallthrough\]\], \[\[nodiscard\]\], \[\[maybe_unused\]\] attributes](#fallthrough-nodiscard-maybe_unused-attributes)
|
||||
- [\_\_has\_include](#\_\_has\_include)
|
||||
|
||||
C++17 includes the following new library features:
|
||||
@@ -265,7 +265,7 @@ byte d = byte{1}; // OK
|
||||
byte e = byte{256}; // ERROR
|
||||
```
|
||||
|
||||
### fallthrough, nodiscard, maybe_unused 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. This attribute may only be used in a switch statement, and must be placed before the next case/default label.
|
||||
```c++
|
||||
|
||||
Reference in New Issue
Block a user