std::chrono...year_month)(3)
π NAME π
okay so this manual page is for std::chrono::operator<<(std::chrono::year_month) β and yes, that is the whole iconic name, no cap. It's hanging out in the C++ Standard Library section of the manual, and it's literally the stream-output operator for std::chrono::year_month. It's giving "let's make this chrono type printable" energy. π
β¨
β¨ Synopsis β¨
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& ym );
(since C++20)
It outputs a textual representation of ym into the stream os, as if by:
os << std::format(os.getloc(), STATICALLY_WIDEN<CharT>("{}/{:L}"), ym.year(),
ym.month())
where STATICALLY_WIDEN<CharT>("{}/{:L}") is "{}/{:L}" if CharT is char, and L"{}/{:L}" if CharT is wchar_t. π
π«Ά Return value π«Ά
It returns os. That's it, that's the return value bestie β os is right there, living its main character life. π
π Example π
This section is incomplete.
Reason: no example
Like... no example, bestie. We are not inventing one, we are respecting the manual's unfinished era. π
π₯ 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:
Lis needed to use the given locale
So yeah, P2372R3 came through and said "actually, L is needed to use the given locale." Periodt. π
π¦ See also π¦
format(C++20) β stores formatted representation of the arguments in a new string (function template)std::formatter<std::chrono::year_month>(C++20) β formatting support foryear_month(class template specialization)
Obsessed with the formatting support, honestly. β¨
π Category π
Todo no example
mwah π β this cutie came from http://cppreference.com, version/date 2024.06.10. Slay and goodbye, bestie! πΈπ¦
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms