max_recode_code_pointsļƒ

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_point = ztd::text::code_point_t<ztd::text::utf8>;
constexpr std::size_t max_output_size = ztd::text::max_recode_code_points_v<ztd::text::utf8, ztd::text::utf16>;

// C++-style
std::array<code_point, max_output_size> my_cxx_buffer;
// or C-style
code_point my_c_buffer[max_output_size];
template<typename _From, typename _To>
static constexpr ::std::size_t ztd::text::max_recode_code_points_v = max_code_units_v<_From> * max_code_points_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.