std::chrono...::sys_time)(3)
πΈ std::chrono::operator<<(std::chrono::sys_time) π
okay bestie, welcome to the C++ Standard Library manual, section 3 β and yeah, the header spells it C++ Standard Libary, so we're letting that typo have its main character moment π. This page is from the C++ Standard Library manual and it's all about std::chrono::operator<<(std::chrono::sys_time) β chrono stream operator vibes, no cap. π°οΈβ¨
πΈ NAME πΈ
std::chrono::operator<<(std::chrono::sys_time) β and yep, the name is literally repeated: std::chrono::operator<<(std::chrono::sys_time). that's the whole name, bestie. π
π Synopsis π
Defined in header <chrono> β¨
template< class CharT, class Traits, class Duration >
std::basic_ostream<CharT, Traits>& (1)
(since C++20)
operator<<( std::basic_ostream<CharT, Traits>& os,
const std::chrono::sys_time<Duration>& tp );
template< class CharT, class Traits, class Duration >
std::basic_ostream<CharT, Traits>& (2)
(since C++20)
operator<<( std::basic_ostream<CharT, Traits>& os,
const std::chrono::sys_days& tp );
Outputs tp into the stream os. π«Ά
1) Equivalent to:
return os << std::format(os.getloc(), STATICALLY-WIDEN<CharT>("{:L%F %T}"), tp);
where STATICALLY_WIDEN<CharT>("{:L%F %T}") is "{:L%F %T}" if CharT is char, and L"{:L%F %T}" if CharT is wchar_t.
This overload participates in overload resolution only if std::chrono::treat_as_floating_point_v<typename Duration::rep> is false and Duration(1) < std::chrono::days(1).
2) Equivalent to os << std::chrono::year_month_day(tp);.
π Return value π
os β that's it, that's the return value, bestie. π«Ά
π©Ή 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
π See also π
std::formatter<std::chrono::sys_time>β formatting support forsys_time(C++20) (class template specialization) πformatβ stores formatted representation of the arguments in a new string (C++20) (function template) β¨operator<<β outputs ayear_month_dayinto a stream (C++20) (function template) π
mwah π source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::chrono...::sys_time)(3).
π¦ 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