std::chrono...eekday_last)(3)

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

πŸ’– NAME πŸ’–

Okay bestie, the name is std::chrono::operator<<(std::chrono::year_month_weekday_last) β€” and then the dash β€” and then, because the manual literally said it twice, the exact same std::chrono::operator<<(std::chrono::year_month_weekday_last) again. No cap, that's the NAME line: name, dash, name. 🫢

✨ Synopsis ✨

This page is from the C++ Standard Libary manual (yes, that spelling is the manual's, I'm just the messenger πŸ™ˆ), and the page label is std::chrono...eekday_last)(3).

Defined in header <chrono> ✨

template< class CharT, class Traits >

std::basic_ostream<CharT, Traits>&
operator<<( std::basic_ostream<CharT, Traits>& os,

            const std::chrono::year_month_weekday_last& ymwdl );

Since C++20 ((since C++20) on the page πŸ’…).

It outputs a textual representation of ymwdl into os, as if by:

os << std::format(os.getloc(),
STATICALLY_WIDEN<CharT>("{}/{:L}/{:L}"),
                     ymwdl.year(), ymwdl.month(), ymwdl.weekday_last());

Where STATICALLY_WIDEN<CharT>("{}/{:L}/{:L}") is "{}/{:L}/{:L}" if CharT is char, and L"..." if CharT is wchar_t. That's the whole translation unit of a vibe check, literally. πŸ¦‹

πŸŽ€ Return value πŸŽ€

It returns os. That's it β€” os is the whole return value, and honestly? iconic. πŸ’–

πŸ’… Defect reports πŸ’…

The following behavior-changing defect reports were applied retroactively to previously published C++ standards (committee time travel, but make it paperwork ✨). The columns are DR, Applied to, Behavior as published, and Correct behavior.

  • 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::year_month_day> (C++20) β€” formatting support for year_month_day (class template specialization).

Okay bestie, that's the whole page πŸ’œ. Source/URL: http://cppreference.com; version/date: 2024.06.10; page footer label: std::chrono...eekday_last)(3). Mwah πŸ’‹

πŸ“¦ where this page comes from