STD::MONEY_PUT(3)
π std::money_put< _CharT, _OutIter > π
okay bestie, gather round, we're doing a library functions manual page today and it's giving template energy π
This is the man page for std::money_put< _CharT, _OutIter >, part of libstdc++ (that's the GNU C++ standard library, section 3 of the manual, iykyk). It's a facet, it formats money, and it's literally the reason your $10.01 doesn't come out looking like 1001. Periodt. π
β¨ NAME β¨
std::money_put< _CharT, _OutIter > β the Primary class template money_put. π
β¨ SYNOPSIS β¨
#include <locale>
It Inherits std::locale::facet 𧬠(so yes, it's part of the locale fam).
π« Public Types π«
These are the Public typedefs, and there are exactly three of them, no more no less:
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β no description given, she's mysterious like that π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. (yes, "Numpunct", that's what it says, don't come for me π)
π« 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) constβ again, no description, we love a lowkey entry πvirtual 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. That's her whole job, and she eats every time. πΈ
The money_put template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. And those virtual functions? They're hooks for developers to implement the behavior they require from the money_put facet. So like, if you wanna customize, the door is open, bestie π«Ά
π¦ 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.
πΈ Constructor & Destructor Documentation πΈ
money_put β the constructor π
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. Iconic, standard-issue, no notes. β¨
Parameters
__refsβ Passed to the base facet class.
References std::locale::facet::facet().
~money_put β the destructor π
template<typename _CharT, typename _OutIter>
virtual std::money_put< _CharT, _OutIter >::~money_put () [inline], [protected], [virtual]
Destructor. That's it, that's the whole description, she's leaving the group chat πͺ
π₯ Member Function Documentation π₯
do_put (the string_type 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. π₯
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 touse_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.
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. π°
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 touse_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::ios_base::getloc(), std::use_facet(), and std::__ctype_abstract_base< _CharT >::widen().
Referenced by put(), and put().
put (the string_type one)
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().
Parameters
__sβ The stream to write to.__intlβ Parameter touse_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 do_put().
put (the long double one)
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().
Parameters
__sβ The stream to write to.__intlβ Parameter touse_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 do_put().
π Member Data Documentation π
template<typename _CharT, typename _OutIter>
locale::id std::money_put< _CharT, _OutIter >::id [static]
Numpunct facet id. One static attribute, one job. π
β Author β
Generated automatically by Doxygen for libstdc++ from the source code. Not a human, just a very thorough robot, and honestly? She ate. π€β¨
lowkey the whole vibe: this page is from libstdc++ β that's the source/version, bestie π«Ά β and the footer date situation is literally juststd::money..._OutIter >(3)repeated, so here's the cute sign-off instead: libstdc++,std::money..._OutIter >(3), that's a wrap. byeee πππ¦
π¦ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- centos-stream 10: gcc-toolset-15-libstdc++-docs 15.2.1-8.1.el10 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- centos-stream 10: gcc-toolset-16-libstdc++-docs 16.2.1-1.3.el10 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- centos-stream 10: libstdc++-docs 14.4.1-4.el10 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 43: libstdc++-docs 15.2.1-2.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 43: libstdc++-docs 15.3.1-1.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms