make_decode_stateļ
This detects when the decode_state
of a given encoding
requires the encoding
itself to make said state. If so, it will call the decode_state
ās constructor with the encoding passed in. Otherwise, it simply default-constructs a state. In either case, the constructed value is returned to the user.
The classification for this is done by ztd::text::is_decode_state_independent.
-
template<typename _Encoding>
constexpr decode_state_t<remove_cvref_t<_Encoding>> ztd::text::make_decode_state(_Encoding &__encoding) noexceptļ Constructs the
decode_state
of the given encoding, based on whether or not the encoding and state meet the criteria of ztd::text::is_decode_state_independent_v.- Parameters
__encoding ā [in] The encoding object to use, if applicable, for the construction of the state.
-
template<typename _Encoding>
constexpr decode_state_t<remove_cvref_t<_Encoding>> ztd::text::make_decode_state_with(_Encoding &__encoding, const encode_state_t<remove_cvref_t<_Encoding>> &__encode_state) noexceptļ Constructs the
decode_state
of the given encoding, based on whether or not the encoding and state meet the criteria of ztd::text::is_decode_state_independent_v or whether it can be created by copy construction from the given__encode_state
.- Parameters
__encoding ā [in] The encoding object to use, if applicable, for the construction of the state.
__encode_state ā [in] A preexisting state from the encoder.