max_transcode_code_unitsļƒ

The maximum number of code units needed for a given encoding object. This can be used to create a suitably-sized automatic storage duration buffer, e.g.

using code_unit = ztd::text::code_unit_t<ztd::text::utf8>;
constexpr std::size_t max_output_size = ztd::text::max_transcode_code_units_v<ztd::text::utf16, ztd::text::utf8>;

// C++-style
std::array<code_unit, max_output_size> my_cxx_buffer;
// or C-style
code_unit my_c_buffer[max_output_size];
template<typename _From, typename _To>
static constexpr ::std::size_t ztd::text::max_transcode_code_units_v = max_code_points_v<_From> * max_code_units_v<_To> * 2ļƒ

Gets the maximum number of code units needed to represent a full ztd::text::transcode_one operation without running out of output space.