|
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
| Nonmember functions | ||||
operator<< | ||||
| Helper classes | ||||
(C++26) |
Defined in header <chrono> | ||
template<class CharT,class Traits> std::basic_ostream<CharT, Traits>& | (since C++20) | |
If!m.ok(), insertsunsigned(m) followed by" is not a valid month" toos. Otherwise, forms astd::basic_string<CharT>s consisting of the abbreviated month name for the month represented bym, determined using the locale associated withos, and insertss intoos.
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)));
whereSTATICALLY_WIDEN<CharT>("...") is"..." ifCharT ischar, andL"..." ifCharT iswchar_t.
Contents |
os
Thisoperator<< is primarily intended for debugging use. For control over formatting, usestd::format.
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| P2372R3 | C++20 | the given locale was used by default | L is needed to use the given locale |
(C++20) | stores formatted representation of the arguments in a new string (function template)[edit] |
formatting support formonth(class template specialization)[edit] |