unicode_code_point
If ZTD_TEXT_UNICODE_CODE_POINT_DISTINCT_TYPE is turned on, this type definition points to an internal class which implements the invariant of being a unicode code point. Otherwise, it is simply char32_t
.
A unicode code point is stored as an at least 32-bit value, but may occupy more space depending on the architecture. It requires 21 bits of space to fit the required unicode code point definition. If the distinct type is used, then this type will trap (abort
/assert
) if the value is greater than the allowed 21 bits.
-
typedef char32_t ztd::text::unicode_code_point
Internal Type
Warning
⚠️ Names with double underscores, and within the __*detail
and __*impl
namespaces are reserved for the implementation. Referencing this entity directly is bad, and the name/functionality can be changed at any point in the future. Relying on anything not guaranteed by the documentation is ☢️☢️Undefined Behavior☢️☢️.
-
class __unicode_code_point
A 32-bit value that is within the allowed 21 bits of Unicode. Can be one of the surrogate values.
Public Functions
-
__unicode_code_point() noexcept = default
Constructs a code point value of indeterminate value (if no parentheses/brackets are provided) or with the value 0 (if parentheses/brackets are provided for intentional value initialization).
-
inline constexpr __unicode_code_point(char32_t __code_point) noexcept
Constructs a code point value with the given code point value.
Remark
-
inline explicit constexpr operator char32_t() const noexcept
An explicit conversion to a typical char32_t value, bit-compatible with a normal code point value.
-
inline constexpr const char32_t &value() const & noexcept
Retrieves the underlying value.
-
inline constexpr char32_t &value() & noexcept
Retrieves the underlying value.
-
inline constexpr char32_t &&value() && noexcept
Retrieves the underlying value.
-
__unicode_code_point() noexcept = default