std::chrono...::month_day)(3)

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

πŸ’– NAME πŸ’–

Page title: std::chrono...::month_day)(3). Manual name: C++ Standard Libary β€” yes bestie, that's the spelling in the header, we're not fixing it ✨.

std::chrono::operator<<(std::chrono::month_day) - std::chrono::operator<<(std::chrono::month_day)

Lowkey it's the std::chrono::month_day stream insertion operator, and the name section is just saying that exact thing twice. Iconic, honestly. πŸ’…

πŸ¦‹ Synopsis πŸ¦‹

Defined in header <chrono>, no cap.

Defined in header <chrono>
template< class CharT, class Traits >

std::basic_ostream<CharT, Traits>&
(since C++20)

    operator<<( std::basic_ostream<CharT, Traits>& os, const
std::chrono::month_day& md );

It's a function template since C++20, and it outputs a textual representation of md into the stream os, as if by:

os << std::format(os.getloc(), STATICALLY_WIDEN<CharT>("{:L}/{}"),
       md.month(),
          md.day())

where STATICALLY_WIDEN<CharT>("{:L}/{}") is "{:L}/{}" if CharT is char, and L"{:L}/{}" if CharT is wchar_t. That's the whole sauce. 🫢

πŸŽ€ Return value πŸŽ€

os. That's it. It just returns os, like a good little stream. periodt. πŸ’…

🌸 Example 🌸

This section is incomplete Reason: no example

Not me finding zero examples in the building 😭. The page literally says it's incomplete and the reason is no example.

πŸ”₯ Defect reports πŸ”₯

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

  • DR 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) β€” stores formatted representation of the arguments in a new string (function template)
  • std::formatter<std::chrono::month_day> (C++20) β€” formatting support for month_day (class template specialization)

πŸ“ Category πŸ“

  • * Todo no example

xoxo, source/version: http://cppreference.com; dated 2024.06.10; page title: std::chrono...::month_day)(3) πŸ’–

πŸ“¦ where this page comes from