mirror of
https://github.com/AnthonyCalandra/modern-cpp-features.git
synced 2025-12-18 10:34:35 +03:00
UTF-8 character literals.
This commit is contained in:
@@ -15,6 +15,7 @@ C++17 includes the following new language features:
|
|||||||
- [structured bindings](#structured-bindings)
|
- [structured bindings](#structured-bindings)
|
||||||
- [selection statements with initializer](#selection-statements-with-initializer)
|
- [selection statements with initializer](#selection-statements-with-initializer)
|
||||||
- [constexpr if](#constexpr-if)
|
- [constexpr if](#constexpr-if)
|
||||||
|
- [utf-8 character literals](#utf-8-character-literals)
|
||||||
|
|
||||||
C++17 includes the following new library features:
|
C++17 includes the following new library features:
|
||||||
- [std::variant](#stdvariant)
|
- [std::variant](#stdvariant)
|
||||||
@@ -259,6 +260,12 @@ struct S {};
|
|||||||
static_assert(isIntegral<S>() == false);
|
static_assert(isIntegral<S>() == false);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### UTF-8 Character Literals
|
||||||
|
A character literal that begins with `u8` is a character literal of type `char`. The value of a UTF-8 character literal is equal to its ISO 10646 code point value.
|
||||||
|
```c++
|
||||||
|
char x = u8'x';
|
||||||
|
```
|
||||||
|
|
||||||
## C++17 Library Features
|
## C++17 Library Features
|
||||||
|
|
||||||
### std::variant
|
### std::variant
|
||||||
|
|||||||
Reference in New Issue
Block a user