is_code_points_(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_points_replaceable
) or a std::optional
of a replacement range (is_code_points_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_points_replaceable : public is_detected<__txt_detail::__detect_is_code_points_replaceable, _Type, _Args...>ļ Checks whether the given encoding type returns a maybe-replacement range of code points.
Remark
The
value
boolean is true if the given_Type
has a function namedreplacement_code_points()
on it that can be called from aconst
-qualified_Type
object which returns a contiguous view of code points.- Template Parameters
_Type ā The type to check for the proper function call.
-
template<typename _Type, typename ..._Args>
constexpr bool ztd::text::is_code_points_replaceable_v = is_code_points_replaceable<_Type, _Args...>::valueļ An alias of the inner
value
for ztd::text::is_code_points_replaceable.
-
template<typename _Type, typename ..._Args>
class is_code_points_maybe_replaceable : public is_detected<__txt_detail::__detect_is_code_points_maybe_replaceable, _Type, _Args...>ļ Checks whether the given encoding type returns a maybe-replacement range of code points.
Remark
The
value
boolean is true if the given_Type
has a function namedmaybe_replacement_code_points()
on it that can be called from aconst
-qualified_Type
object which returns astd::optional
containing a contiguous view of code points.- Template Parameters
_Type ā The type to check for the proper function call.
-
template<typename _Type, typename ..._Args>
constexpr bool ztd::text::is_code_points_maybe_replaceable_v = is_code_points_maybe_replaceable<_Type, _Args...>::valueļ An alias of the inner
value
for ztd::text::is_code_points_maybe_replaceable.