STD::TIME_PUT(3cxx)
π std::time_put< _CharT, _OutIter > β manual section 3cxx, bestie π
okay so you found the 3cxx manual page for std::time_put< _CharT, _OutIter > and honestly? iconic of you. sit down, grab a strawberry drink π, and let's get into it.
πΈ NAME
std::time_put< _CharT, _OutIter > β the primary class template time_put. that's it, that's the name, she's a template and she's the primary one π
β¨ SYNOPSIS
#include <locale>
Inherits std::locale::facet.
Inherited by std::time_put_byname< _CharT, _OutIter >. so she's got a whole byname daughter, main character family tree fr fr π
π Public Types
typedef _CharT char_typeβ public typedef, bestie. the char type. yeah.typedef _OutIter iter_typeβ public typedef. the iterator type. the way that it just sits there being public? obsessed.
π Public Member Functions
time_put (size_t __refs=0)β constructor, does the initialization thing. default__refsis0, don't forget β¨iter_type put (iter_type __s, ios_base &__io, char_type __fill, const tm *__tm, char __format, char __mod=0) constβ format and output a time or date. note__moddefaults to0πiter_type put (iter_type __s, ios_base &__io, char_type __fill, const tm *__tm, const _CharT *__beg, const _CharT *__end) constβ format and output a time or date, but this time with a__beg/__endrange instead of a format char. twoputs, two vibes π
π¦ Static Public Attributes
static locale::id idβ "Numpunct facet id." yes bestie that's literally what the page says, and we are NOT editing the facts. that's the label, periodt.
π§ Protected Member Functions
virtual ~time_put ()β destructor. virtual. protected. she's shy but she cleans up π«Άvirtual iter_type do_put (iter_type __s, ios_base &__io, char_type __fill, const tm *__tm, char __format, char __mod) constβ format and output a time or date. this is the hook, the one the derived classes override. yes, the signature is exactly that and no,__modhas no default here π
β 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)
look at the whole little static protected squad π all of them listed, none of them skipped. and yes, _S_clone_c_locale and _S_get_c_name really do say throw (), we're keeping that exactly π―
π₯ Detailed Description
template<typename _CharT, typename _OutIter>
class std::time_put< _CharT, _OutIter >
Primary class template time_put. β¨
This facet encapsulates the code to format and output dates and times according to formats used by strftime(). it's giving "I speak calendar" ποΈ
The time_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 time_put facet. so: public face, protected brain, devs get to plug in their own behavior. slay π§ π
π Member Typedef Documentation
template<typename _CharT , typename _OutIter > typedef _CharT std::time_put< _CharT, _OutIter >::char_type
Public typedefs. that's the whole description. short and confident π
template<typename _CharT , typename _OutIter > typedef _OutIter std::time_put< _CharT, _OutIter >::iter_type
Public typedefs again. she said "I'll say it twice" and honestly? valid πΈ
π Constructor & Destructor Documentation
template<typename _CharT , typename _OutIter > std::time_put< _CharT, _OutIter >::time_put (size_t __refs = 0) [inline], [explicit]
Constructor performs initialization. This is the constructor provided by the standard. no custom chaos, just the standard one, we love a compliant queen π
Parameters
__refsβ Passed to the base facet class.
template<typename _CharT , typename _OutIter > virtual std::time_put< _CharT, _OutIter >::~time_put () [inline], [protected], [virtual]
Destructor. three tags: [inline], [protected], [virtual]. she's leaving the party quietly π¦
π Member Function Documentation
template<typename _CharT , typename _OutIter > _OutIter std::time_put< _CharT, _OutIter >::do_put (iter_type __s, ios_base & __io, char_type __fill, const tm * __tm, char __format, char __mod) const [protected], [virtual]
Format and output a time or date. This function formats the data in struct tm according to the provided format char and optional modifier. This function is a hook for derived classes to change the value returned.
See also: put() for more details. β yeah bestie, go read put(), it's right below π
Parameters
__sβ The stream to write to.__ioβ Source of locale.__fillβchar_typeto use for padding.__tmβ Structtmwith date and time info to format.__formatβ Format char.__modβ Optional modifier char.
Returns: Iterator after writing.
References std::ios_base::_M_getloc(), and std::__ctype_abstract_base< _CharT >::widen(). (exact spellings, don't @ me)
Referenced by std::time_put< _CharT, _OutIter >::put().
template<typename _CharT , typename _OutIter > iter_type std::time_put< _CharT, _OutIter >::put (iter_type __s, ios_base & __io, char_type __fill, const tm * __tm, char __format, char __mod = 0) const [inline]
Format and output a time or date. This function formats the data in struct tm according to the provided format char and optional modifier. The format and modifier are interpreted as by strftime(). It does so by returning time_put::do_put(). so it's the public bestie that just forwards to the protected hook β delegation, we stan π₯
Parameters
__sβ The stream to write to.__ioβ Source of locale.__fillβchar_typeto use for padding.__tmβ Structtmwith date and time info to format.__formatβ Format char.__modβ Optional modifier char.
Returns: Iterator after writing.
References std::time_put< _CharT, _OutIter >::do_put().
template<typename _CharT , typename _OutIter > _OutIter std::time_put< _CharT, _OutIter >::put (iter_type __s, ios_base & __io, char_type __fill, const tm * __tm, const _CharT * __beg, const _CharT * __end) const
Format and output a time or date. This function formats the data in struct tm according to the provided format string. The format string is interpreted as by strftime(). whole string instead of one char β she contains multitudes π
Parameters
__sβ The stream to write to.__ioβ Source of locale.__fillβchar_typeto use for padding.__tmβ Structtmwith date and time info to format.__begβ Start of format string.__endβ End of format string.
Returns: Iterator after writing.
References std::ios_base::_M_getloc(), and std::__ctype_abstract_base< _CharT >::narrow(). (yup, narrow() this time, not widen() β the details MATTER)
π Member Data Documentation
template<typename _CharT , typename _OutIter > locale::id std::time_put< _CharT, _OutIter >::id [static]
Numpunct facet id. that's what the page says, that's what I'm telling you, no notes π (it's locale::id, it's [static], and the description is exactly that one line.)
π« Author
Generated automatically by Doxygen for libstdc++ from the source code. not a human, just a very diligent robot doing her thing π€β¨
heads up bestie: everything above is quoted straight from the page's own descriptions β I'm not adding extra behavior lore, so if you need the deep semantics, that's strftime()'s business π«Ά
and that's the whole page!! no flags skipped, no throw () quietly deleted, no missing __mod=0. you ate this one up ngl π
π
β xoxo, your 3cxx girl: this one's from the libstdc++ source/version, auto-generated by Doxygen for libstdc++ from the source code, and signed off at the bottom of the page as libst ππ periodt.
π¦ 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