BloombergLP::bslalg::NumericFormatterUtil::ToCharsMaxLength

Minimum buffer size for toChars conversion of TYPE.

Synopsis

Declared in <bslalg_numericformatterutil.h>

template<
    class TYPE,
    int ARG = k_MAXLEN_ARG_DEFAULT>
struct ToCharsMaxLength;

Description

This struct template implements the meta-function to determine the minimum sufficient size of a buffer to successfully convert any numeric value of a specified TYPE supported by one of the toChars function overloads in NumericFormatterUtil. The meta-function allows specifying an argument value to the toChars overloads, as a non-type template parameter. That value stands for the base parameter for integral conversions, and the format parameter for floating point conversions. A second non-type template parameter is reserved for further addition in case the precision parameter overloads are implemented for floating point conversions (in addition to the format parameter). The compile-time "return value" of ToCharsMaxLength is an enumerator name k_VALUE. For usage examples see {Example 3: Determining The Required Buffer Size}.

Enums

NameDescription
ValueType Maximum buffer length required for the selected type and argument.