Files
2025-10-25 03:02:53 +03:00

2.7 KiB

[category.numeric.general]

28 Text processing library [text]

28.3 Localization library [localization]

28.3.4 Standard locale categories [locale.categories]

28.3.4.3 The numeric category [category.numeric]

28.3.4.3.1 General [category.numeric.general]

1

#

The classes num_get<> and num_put<> handle numeric formatting and parsing.

Virtual functions are provided for several numeric types.

Implementations may (but are not required to) delegate extraction of smaller types to extractors for larger types.223

2

#

All specifications of member functions for num_put and num_get in the subclauses of [category.numeric] only apply to the specializations required in Tables 91 and 92 ([locale.category]), namelynum_get,num_get<wchar_t>,num_get<C, InputIterator>,num_put,num_put<wchar_t>, andnum_put<C, OutputIterator>.

These specializations refer to the ios_base& argument for formatting specifications ([locale.categories]), and to its imbued locale for the numpunct<> facet to identify all numeric punctuation preferences, and also for the ctype<> facet to perform character classification.

3

#

Extractor and inserter members of the standard iostreams usenum_get<> and num_put<> member functions for formatting and parsing numeric values ([istream.formatted.reqmts], [ostream.formatted.reqmts]).

223)223)

Parsing "-1" correctly into, e.g., an unsigned short requires that the corresponding member get() at least extract the sign before delegating.