|
utf-42
|
Container holding all character-encoded views of a string literal. More...
#include <utf42.h>

Public Member Functions | |
| constexpr | poly_enc (const basic_string_view< char > txt_char, const basic_string_view< wchar_t > txt_char_w, const basic_string_view< char16_t > txt_char_16, const basic_string_view< char32_t > txt_char_32) noexcept |
| Constructs a polymorphic encoding container. | |
| template<typename char_t > | |
| constexpr basic_string_view< char_t > | visit () const noexcept |
| Selects the appropriate encoded string view for a given character type. | |
| template<> | |
| constexpr basic_string_view< char > | visit () const noexcept |
| template<> | |
| constexpr basic_string_view< wchar_t > | visit () const noexcept |
| template<> | |
| constexpr basic_string_view< char16_t > | visit () const noexcept |
| template<> | |
| constexpr basic_string_view< char32_t > | visit () const noexcept |
Public Attributes | |
| basic_string_view< char > | TXT_CHAR |
| Narrow character literal. | |
| basic_string_view< wchar_t > | TXT_CHAR_W |
| Wide character literal. | |
| basic_string_view< char16_t > | TXT_CHAR_16 |
| UTF-16 character literal. | |
| basic_string_view< char32_t > | TXT_CHAR_32 |
| UTF-32 character literal. | |
Container holding all character-encoded views of a string literal.
Instances of this type are intended to be constructed only from string literals. Each member corresponds to a distinct literal encoding generated by the compiler.
No ownership is taken; all views refer directly to static storage.
|
inlineconstexprnoexcept |
Constructs a polymorphic encoding container.
| txt_char | Narrow character string view. |
| txt_char_w | Wide character string view. |
| txt_char_8 | UTF-8 string view. Only defined if C++20 is available. |
| txt_char_16 | UTF-16 string view. |
| txt_char_32 | UTF-32 string view. |
|
constexprnoexcept |
Selects the appropriate encoded string view for a given character type.
This function is evaluated at compile time and returns a std::basic_string_view<char_t> referring to the correctly encoded literal stored in the provided poly_enc. Returns an empty string if the character type is not recognized.
| char_t | Desired character type. |