STD::MONEY_PUT(3cxx)
πΈ std::money_put< _CharT, _OutIter > β NAME π
okay so bestie, welcome to the <locale> corner of libstdc++ where we have the std::money_put< _CharT, _OutIter > β the Primary class template money_put. that's the whole name section, she's short and sweet, no cap π
β¨ SYNOPSIS β¨
#include <locale>
Inherits std::locale::facet. yes, she's a facet, that's her whole identity, and she's iconic for it π¦
πΈ Public Types
typedef _CharT char_typeβ Public typedefs.typedef _OutIter iter_typeβ Public typedefs.typedef basic_string< _CharT > string_typeβ Public typedefs.
π Public Member Functions
money_put (size_t __refs=0)β Constructor performs initialization.template<bool _Intl> _OutIter _M_insert (iter_type __s, ios_base &__io, char_type __fill, const string_type &__digits) constβ (yes, this one's in the public list too, don't @ me, I just report what the source says π)iter_type put (iter_type __s, bool __intl, ios_base &__io, char_type __fill, const string_type &__digits) constβ Format and output a monetary value.iter_type put (iter_type __s, bool __intl, ios_base &__io, char_type __fill, long double __units) constβ Format and output a monetary value.
β Static Public Attributes
static locale::id idβ Numpunct facet id.
π§ Protected Member Functions
virtual ~money_put ()β Destructor.template<bool _Intl> iter_type _M_insert (iter_type __s, ios_base &__io, char_type __fill, const string_type &__digits) constvirtual iter_type do_put (iter_type __s, bool __intl, ios_base &__io, char_type __fill, const string_type &__digits) constβ Format and output a monetary value.virtual iter_type do_put (iter_type __s, bool __intl, ios_base &__io, char_type __fill, long double __units) constβ Format and output a monetary value.
π«Ά Static Protected Member Functions
static __c_locale _S_clone_c_locale (__c_locale &__cloc) throw ()static void _S_create_c_locale (__c_locale &__cloc, const char *__s, __c_locale __old=0)static void _S_destroy_c_locale (__c_locale &__cloc)static __c_locale _S_get_c_locale ()static const char * _S_get_c_name () throw ()static __c_locale _S_lc_ctype_c_locale (__c_locale __cloc, const char *__s)
π Detailed Description π
template<typename _CharT, typename _OutIter>
class std::money_put< _CharT, _OutIter >
"Primary class template money_put."
This facet encapsulates the code to format and output a monetary amount. like, she literally holds the whole bag of tricks for making numbers look like money π°β¨
The money_put template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. These virtual functions are hooks for developers to implement the behavior they require from the money_put facet. so you (yes YOU) can subclass her and make her do your bidding πͺ
π¦ Member Typedef Documentation π¦
template<typename _CharT , typename _OutIter > typedef _CharT
std::money_put< _CharT, _OutIter >::char_type
Public typedefs. π
template<typename _CharT , typename _OutIter > typedef _OutIter
std::money_put< _CharT, _OutIter >::iter_type
Public typedefs. π
template<typename _CharT , typename _OutIter > typedef basic_string<_CharT>
std::money_put< _CharT, _OutIter >::string_type
Public typedefs. π (yes all three say the same thing, she's consistent, periodt)
π₯ Constructor & Destructor Documentation π₯
template<typename _CharT , typename _OutIter > std::money_put< _CharT,
_OutIter >::money_put (size_t __refs = 0) [inline], [explicit]
Constructor performs initialization. This is the constructor provided by the standard. nothing weird, nothing custom, just the standard-issue constructor doing her little job π
Parameters
__refsβ Passed to the base facet class.
template<typename _CharT , typename _OutIter > virtual std::money_put<
_CharT, _OutIter >::~money_put () [inline], [protected], [virtual]
Destructor. she's [protected] and [virtual], so you can't just delete her from outside, that's not how we do things here π
π Member Function Documentation π
1οΈβ£ do_put β the digits one π
template<typename _CharT , typename _OutIter > _OutIter std::money_put<
_CharT, _OutIter >::do_put (iter_type __s, bool __intl, ios_base & __io,
char_type __fill, const string_type & __digits) const [protected],
[virtual]
Format and output a monetary value. This function formats digits as a monetary value according to moneypunct and ctype facets retrieved from io.getloc(), and writes the resulting characters to __s. For example, the string 1001 in a US locale would write $10.01 to __s. literally turning your digits into dolla bills π€
This function is a hook for derived classes to change the value returned.
See also: put().
Parameters
__sβ The stream to write to.__intlβ Parameter to use_facet<moneypunct<CharT,intl> >.__ioβ Source of facets and io state.__fillβchar_typeto use for padding.__digitsβ Place to store result of parsing.
Returns
Iterator after writing.
2οΈβ£ do_put β the long double one π«
template<typename _CharT , typename _OutIter > _OutIter std::money_put<
_CharT, _OutIter >::do_put (iter_type __s, bool __intl, ios_base & __io,
char_type __fill, long double __units) const [protected], [virtual]
Format and output a monetary value. This function formats units as a monetary value according to moneypunct and ctype facets retrieved from io.getloc(), and writes the resulting characters to __s. For example, the value 1001 in a US locale would write $10.01 to __s. same energy, different argument type, she contains multitudes β¨
This function is a hook for derived classes to change the value returned.
See also: put().
Parameters
__sβ The stream to write to.__intlβ Parameter to use_facet<moneypunct<CharT,intl> >.__ioβ Source of facets and io state.__fillβchar_typeto use for padding.__unitsβ Place to store result of parsing.
Returns
Iterator after writing.
Referencesstd::ios_base::getloc(), andstd::__ctype_abstract_base< _CharT >::widen(). Referenced bystd::money_put< _CharT, _OutIter >::put(), andstd::money_put< _CharT, _OutIter >::put().
3οΈβ£ put β the digits version, public accessor πΈ
template<typename _CharT , typename _OutIter > iter_type std::money_put<
_CharT, _OutIter >::put (iter_type __s, bool __intl, ios_base & __io,
char_type __fill, const string_type & __digits) const [inline]
Format and output a monetary value. This function formats digits as a monetary value according to moneypunct and ctype facets retrieved from io.getloc(), and writes the resulting characters to __s. For example, the string 1001 in a US locale would write $10.01 to __s.
This function works by returning the result of do_put(). she's just the friendly front desk, do_put() does the actual work behind the scenes π
Parameters
__sβ The stream to write to.__intlβ Parameter to use_facet<moneypunct<CharT,intl> >.__ioβ Source of facets and io state.__fillβchar_typeto use for padding.__digitsβ Place to store result of parsing.
Returns
Iterator after writing.
References std::money_put< _CharT, _OutIter >::do_put().
4οΈβ£ put β the long double version, public accessor π¦
template<typename _CharT , typename _OutIter > iter_type std::money_put<
_CharT, _OutIter >::put (iter_type __s, bool __intl, ios_base & __io,
char_type __fill, long double __units) const [inline]
Format and output a monetary value. This function formats units as a monetary value according to moneypunct and ctype facets retrieved from io.getloc(), and writes the resulting characters to __s. For example, the value 1001 in a US locale would write $10.01 to __s.
This function works by returning the result of do_put(). again, front desk energy π«Ά
Parameters
__sβ The stream to write to.__intlβ Parameter to use_facet<moneypunct<CharT,intl> >.__ioβ Source of facets and io state.__fillβchar_typeto use for padding.__unitsβ Place to store result of parsing.
Returns
Iterator after writing.
References std::money_put< _CharT, _OutIter >::do_put().
π Member Data Documentation π
template<typename _CharT , typename _OutIter > locale::id std::money_put<
_CharT, _OutIter >::id [static]
Numpunct facet id. that's it, that's the data. she's a locale::id, she's [static], she's lowkey famous π«
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. a robot wrote this bit, not even kidding π€
okay that's the whole page bestie, hope it slayed π and yeah β this diva is from libstdc++, and she was generated automatically by Doxygen straight from the source code, so if anything looks cursed, blame the robot, not me π you're so welcome, mwah πβ¨
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms