Move std::char8_t to library section.

This commit is contained in:
Anthony Calandra
2020-06-26 21:56:15 -04:00
parent e8cac18ada
commit 58b21474c8
2 changed files with 14 additions and 14 deletions

View File

@@ -13,7 +13,6 @@ C++20 includes the following new language features:
- [class types in non-type template parameters](#class-types-in-non-type-template-parameters)
- [constexpr virtual functions](#constexpr-virtual-functions)
- [explicit(bool)](#explicitbool)
- [char8_t](#char8_t)
- [immediate functions](#immediate-functions)
- [using enum](#using-enum)
@@ -30,6 +29,7 @@ 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
@@ -298,12 +298,6 @@ foo b = "123"; // ERROR: explicit constructor is not a candidate (explicit speci
foo c {"123"}; // OK
```
### char8_t
Provides a standard type for representing UTF-8 strings.
```c++
char8_t utf8_str[] = u8"\u0123";
```
### Immediate functions
Similar to `constexpr` functions, but functions with a `consteval` specifier must produce a constant. These are called `immediate functions`.
```c++
@@ -493,6 +487,12 @@ 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.