is_code_units_(maybe_)replaceableļƒ

These two traits detect whether or not the given Encoding type have calls on them which return either a replacement range (is_code_units_replaceable) or a std::optional of a replacement range (is_code_units_maybe_replaceable).

The former is useful when it is guaranteed that your encoding will have a replacement range on it and does not need the extra cost of an indirection from not knowing. The latter is useful when something like a wrapped encoding may or may not have a replacement sequence.

template<typename _Type, typename ..._Args>
class is_code_units_replaceable : public is_detected<__txt_detail::__detect_is_code_units_replaceable, _Type, _Args...>ļƒ

Checks whether the given encoding type returns a maybe-replacement range of code units.

Remark

The value boolean is true if the given _Type has a function named replacement_code_units() on it that can be called from a const-qualified _Type which returns a contiguous view of code units.

Template Parameters:

_Type ā€“ The type to check for the proper function call.

template<typename _Type, typename ..._Args>
constexpr bool ztd::text::is_code_units_replaceable_v = is_code_units_replaceable<_Type, _Args...>::valueļƒ

An alias of the inner value for ztd::text::is_code_units_replaceable.

template<typename _Type, typename ..._Args>
class is_code_units_maybe_replaceable : public is_detected<__txt_detail::__detect_is_code_units_maybe_replaceable, _Type, _Args...>ļƒ

Checks whether the given encoding type returns a maybe-replacement range of code units.

Remark

The value boolean is true if the given _Type has a function named maybe_replacement_code_units() on it that can be called from a const -qualified _Type which returns a std::optional containing a contiguous view of code units.

Template Parameters:

_Type ā€“ The type to check for the proper function call.

template<typename _Type, typename ..._Args>
constexpr bool ztd::text::is_code_units_maybe_replaceable_v = is_code_units_maybe_replaceable<_Type, _Args...>::valueļƒ

An alias of the inner value for ztd::text::is_code_units_maybe_replaceable.