mirror of
https://github.com/AnthonyCalandra/modern-cpp-features.git
synced 2025-12-18 18:44:35 +03:00
Move std::char8_t to library section.
This commit is contained in:
14
CPP20.md
14
CPP20.md
@@ -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)
|
- [class types in non-type template parameters](#class-types-in-non-type-template-parameters)
|
||||||
- [constexpr virtual functions](#constexpr-virtual-functions)
|
- [constexpr virtual functions](#constexpr-virtual-functions)
|
||||||
- [explicit(bool)](#explicitbool)
|
- [explicit(bool)](#explicitbool)
|
||||||
- [char8_t](#char8_t)
|
|
||||||
- [immediate functions](#immediate-functions)
|
- [immediate functions](#immediate-functions)
|
||||||
- [using enum](#using-enum)
|
- [using enum](#using-enum)
|
||||||
|
|
||||||
@@ -30,6 +29,7 @@ C++20 includes the following new library features:
|
|||||||
- [std::bit_cast](#stdbit_cast)
|
- [std::bit_cast](#stdbit_cast)
|
||||||
- [std::midpoint](#stdmidpoint)
|
- [std::midpoint](#stdmidpoint)
|
||||||
- [std::to_array](#stdto_array)
|
- [std::to_array](#stdto_array)
|
||||||
|
- [char8_t](#char8_t)
|
||||||
|
|
||||||
## C++20 Language Features
|
## C++20 Language Features
|
||||||
|
|
||||||
@@ -298,12 +298,6 @@ foo b = "123"; // ERROR: explicit constructor is not a candidate (explicit speci
|
|||||||
foo c {"123"}; // OK
|
foo c {"123"}; // OK
|
||||||
```
|
```
|
||||||
|
|
||||||
### char8_t
|
|
||||||
Provides a standard type for representing UTF-8 strings.
|
|
||||||
```c++
|
|
||||||
char8_t utf8_str[] = u8"\u0123";
|
|
||||||
```
|
|
||||||
|
|
||||||
### Immediate functions
|
### Immediate functions
|
||||||
Similar to `constexpr` functions, but functions with a `consteval` specifier must produce a constant. These are called `immediate functions`.
|
Similar to `constexpr` functions, but functions with a `consteval` specifier must produce a constant. These are called `immediate functions`.
|
||||||
```c++
|
```c++
|
||||||
@@ -493,6 +487,12 @@ int a[] = {1, 2, 3};
|
|||||||
std::to_array(a); // returns `std::array<int, 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
|
## Acknowledgements
|
||||||
* [cppreference](http://en.cppreference.com/w/cpp) - especially useful for finding examples and documentation of new library features.
|
* [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.
|
* [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.
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -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)
|
- [class types in non-type template parameters](#class-types-in-non-type-template-parameters)
|
||||||
- [constexpr virtual functions](#constexpr-virtual-functions)
|
- [constexpr virtual functions](#constexpr-virtual-functions)
|
||||||
- [explicit(bool)](#explicitbool)
|
- [explicit(bool)](#explicitbool)
|
||||||
- [char8_t](#char8_t)
|
|
||||||
- [immediate functions](#immediate-functions)
|
- [immediate functions](#immediate-functions)
|
||||||
- [using enum](#using-enum)
|
- [using enum](#using-enum)
|
||||||
|
|
||||||
@@ -30,6 +29,7 @@ C++20 includes the following new library features:
|
|||||||
- [std::bit_cast](#stdbit_cast)
|
- [std::bit_cast](#stdbit_cast)
|
||||||
- [std::midpoint](#stdmidpoint)
|
- [std::midpoint](#stdmidpoint)
|
||||||
- [std::to_array](#stdto_array)
|
- [std::to_array](#stdto_array)
|
||||||
|
- [char8_t](#char8_t)
|
||||||
|
|
||||||
C++17 includes the following new language features:
|
C++17 includes the following new language features:
|
||||||
- [template argument deduction for class templates](#template-argument-deduction-for-class-templates)
|
- [template argument deduction for class templates](#template-argument-deduction-for-class-templates)
|
||||||
@@ -391,12 +391,6 @@ foo b = "123"; // ERROR: explicit constructor is not a candidate (explicit speci
|
|||||||
foo c {"123"}; // OK
|
foo c {"123"}; // OK
|
||||||
```
|
```
|
||||||
|
|
||||||
### char8_t
|
|
||||||
Provides a standard type for representing UTF-8 strings.
|
|
||||||
```c++
|
|
||||||
char8_t utf8_str[] = u8"\u0123";
|
|
||||||
```
|
|
||||||
|
|
||||||
### Immediate functions
|
### Immediate functions
|
||||||
Similar to `constexpr` functions, but functions with a `consteval` specifier must produce a constant. These are called `immediate functions`.
|
Similar to `constexpr` functions, but functions with a `consteval` specifier must produce a constant. These are called `immediate functions`.
|
||||||
```c++
|
```c++
|
||||||
@@ -586,6 +580,12 @@ int a[] = {1, 2, 3};
|
|||||||
std::to_array(a); // returns `std::array<int, 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";
|
||||||
|
```
|
||||||
|
|
||||||
## C++17 Language Features
|
## C++17 Language Features
|
||||||
|
|
||||||
### Template argument deduction for class templates
|
### Template argument deduction for class templates
|
||||||
|
|||||||
Reference in New Issue
Block a user