std::chrono...::hh_mm_ss)(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– NAME πŸ’–

okay bestie, this is the C++ Standard Libary manual, section (3), page for std::chrono::operator<<(std::chrono::hh_mm_ss) 🫢

  • std::chrono::operator<<(std::chrono::hh_mm_ss) β€” std::chrono::operator<<(std::chrono::hh_mm_ss).

✨ Synopsis ✨

Hiii so this one is defined in header <chrono> and it’s since C++20 ✨:

template< class CharT, class Traits, class Duration >
std::basic_ostream<CharT, Traits>&
operator<<( std::basic_ostream<CharT, Traits>& os,
            const std::chrono::hh_mm_ss<Duration>& t );

It outputs t into the stream os, fr fr πŸ’….

Equivalent to:

return os << std::format(os.getloc(), STATICALLY_WIDEN<CharT>("{:L%T}"), hms);

where STATICALLY_WIDEN<CharT>("{:L%T}") is "{:L%T}" if CharT is char, and L"{:L%T}" if CharT is wchar_t πŸ‘‘

πŸŽ€ Parameters πŸŽ€

  • os β€” the output stream, bestie.
  • t β€” the time of day to be output.

🫢 Return value 🫢

Returns os. That’s it, that’s the return value 🫢

πŸ’… Example πŸ’…

This section is incomplete. Reason: no example.

πŸ”₯ Defect reports πŸ”₯

The following behavior-changing defect reports were applied retroactively to previously published C++ standards:

  • P2372R3, applied to C++20 β€” behavior as published: the given locale was used by default. Correct behavior: L is needed to use the given locale.

πŸ¦‹ See also πŸ¦‹

  • format (C++20) β€” function template; stores formatted representation of the arguments in a new string.
  • std::formatter<std::chrono::hh_mm_ss> (C++20) β€” class template specialization; formatting support for hh_mm_ss.

πŸ“ Category πŸ“

  • Todo no example

shoutout to http://cppreference.com and the date 2024.06.10 β€” that’s the source/version and date, bestie, mwah πŸ’‹

πŸ“¦ where this page comes from