mirror of
https://github.com/AnthonyCalandra/modern-cpp-features.git
synced 2025-12-16 17:47:02 +03:00
Move char8_t to the language features section; add char32_t and char16_t.
This commit is contained in:
14
CPP20.md
14
CPP20.md
@@ -17,6 +17,7 @@ C++20 includes the following new language features:
|
||||
- [immediate functions](#immediate-functions)
|
||||
- [using enum](#using-enum)
|
||||
- [lambda capture of parameter pack](#lambda-capture-of-parameter-pack)
|
||||
- [char8_t](#char8_t)
|
||||
|
||||
C++20 includes the following new library features:
|
||||
- [concepts library](#concepts-library)
|
||||
@@ -31,7 +32,6 @@ C++20 includes the following new library features:
|
||||
- [std::bit_cast](#stdbit_cast)
|
||||
- [std::midpoint](#stdmidpoint)
|
||||
- [std::to_array](#stdto_array)
|
||||
- [char8_t](#char8_t)
|
||||
|
||||
## C++20 Language Features
|
||||
|
||||
@@ -412,6 +412,12 @@ auto f(Args&&... args){
|
||||
}
|
||||
```
|
||||
|
||||
### char8_t
|
||||
Provides a standard type for representing UTF-8 strings.
|
||||
```c++
|
||||
char8_t utf8_str[] = u8"\u0123";
|
||||
```
|
||||
|
||||
## C++20 Library Features
|
||||
|
||||
### Concepts library
|
||||
@@ -559,12 +565,6 @@ int a[] = {1, 2, 3};
|
||||
std::to_array(a); // returns `std::array<int, 3>`
|
||||
```
|
||||
|
||||
### char8_t
|
||||
Provides a standard type for representing UTF-8 strings.
|
||||
```c++
|
||||
char8_t utf8_str[] = u8"\u0123";
|
||||
```
|
||||
|
||||
## Acknowledgements
|
||||
* [cppreference](http://en.cppreference.com/w/cpp) - especially useful for finding examples and documentation of new library features.
|
||||
* [C++ Rvalue References Explained](http://thbecker.net/articles/rvalue_references/section_01.html) - a great introduction I used to understand rvalue references, perfect forwarding, and move semantics.
|
||||
|
||||
Reference in New Issue
Block a user