CppTrail
Loading...
Searching...
No Matches
utf42 Namespace Reference

Main namespace of the library. More...

Classes

struct  is_character
 Type trait that checks whether a type is a supported character type. More...
 
struct  poly_enc
 Container holding all character-encoded views of a string literal. More...
 

Concepts

concept  CharacterType
 Concept constraining a type to a supported character type.
 
concept  IntegralType
 Concept constraining a type to an integral type.
 
concept  FloatingPointType
 Concept constraining a type to an floating point type.
 

Typedefs

template<typename char_t >
using basic_string_view = std::basic_string_view< char_t >
 String view type for poly_enc.
 

Functions

template<CharacterType char_t>
consteval std::basic_string_view< char_tvisit_poly_enc (const poly_enc &oPolyEnv)
 Selects the appropriate encoded string view for a given character type.
 

Variables

template<typename T >
constexpr bool is_character_v = is_character<T>::value
 Convenience variable template for is_char.
 

Detailed Description

Main namespace of the library.

Function Documentation

◆ visit_poly_enc()

template<CharacterType char_t>
consteval std::basic_string_view< char_t > utf42::visit_poly_enc ( const poly_enc oPolyEnv)

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.

Template Parameters
char_tDesired character type.
Parameters
oPolyEnvPolymorphic encoding container.
Returns
A string view of the requested character type.

Variable Documentation

◆ is_character_v

template<typename T >
constexpr bool utf42::is_character_v = is_character<T>::value
constexpr

Convenience variable template for is_char.

Template Parameters
TType to check.
Note
Defined only if C++17 is available