std::chrono...rono::month)(3)
okay bestie, welcome to the std::chrono...rono::month)(3) page from the C++ Standard Libary manual β yes, we're doing chrono month stream-out energy today πβ¨
π NAME π
std::chrono::operator<<(std::chrono::month) β literally std::chrono::operator<<(std::chrono::month), no cap. It's the overload that streams a std::chrono::month.
β¨ Synopsis β¨
Defined in header <chrono>.
This overload is (since C++20) and the signature is giving template realness:
template< class CharT, class Traits >
std::basic_ostream<CharT, Traits>&
operator<<( std::basic_ostream<CharT, Traits>& os, const std::chrono::month& m );
If !m.ok(), it inserts unsigned(m) followed by " is not a valid month" into os.
Otherwise, it forms a std::basic_string<CharT> s consisting of the abbreviated month name for the month represented by m, determined using the locale associated with os, and inserts s into os.
Equivalent to:
return os << (m.ok() ?
std::format(os.getloc(), STATICALLY_WIDEN<CharT>("{:L%b}"), m) :
std::format(os.getloc(), STATICALLY_WIDEN<CharT>("{} is not a valid month"),
unsigned(m)));
where STATICALLY_WIDEN<CharT>("...") is "..." if CharT is char, and L"..." if CharT is wchar_t.
π«Ά Return value π«Ά
It returns os. that's it, that's the whole return value bestie π
π Notes π
This operator<< is primarily intended for debugging use. For control over formatting, use std::format.
π 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:
Lis needed to use the given locale
π See also π
formatβ stores formatted representation of the arguments in a new string(C++20)(function template)std::formatter<std::chrono::month>β formatting support for month(C++20)(class template specialization)
kisses and bye bestie π β this page's footer says source/version http://cppreference.com, date 2024.06.10, and page std::chrono...rono::month)(3). periodt π
π¦ 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