is_self_synchronizing_code

An encoding – after experiencing an error or when being dropped into the middle – can seek out the start of the next sequence of well-formed input unambiguously, compared with other encodings that reuse bit patterns from the first matching code unit / byte in subsequent code units / bytes in that pattern. This becomes a property of the encoding, and is therefore called self synchronizing. Self synchronizing codes are frequently considered superior when there is a lack of context.

The primary Unicode encodings are self synchronizing, but other versions both proprietary and not may fail to be self-synchronizing such as UTF-7.

template<typename _Type>
class is_self_synchronizing_code : public __is_self_synchronizing_code_sfinae<::ztd::remove_cvref_t<_Type>>

Checks whether not an encoding has distinct sequences that can be identified unambiguously from anywhere within a larger sequence. This implies that the start of any given sequence &#8212; including sequences that are a single input unit &#8212; can be reliably identified even in a stream full of errors.

Template Parameters:

_Type –

template<typename _Type>
constexpr bool ztd::text::is_self_synchronizing_code_v = is_self_synchronizing_code<::ztd::remove_cvref_t<_Type>>::value

An alias for ztd::is_self_synchronizing_code’s inner value.

Template Parameters:

_Type – The encoding type to check.