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 — including sequences that are a single input unit — 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.