blob: 7a01b186780cb5e292ce7eef4e9f9cd5470697e6 [file] [log] [blame]
Mark de Wevere5d2d3e2022-03-20 12:40:021// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP___CHRONO_OSTREAM_H
11#define _LIBCPP___CHRONO_OSTREAM_H
12
Mark de Wevere5d2d3e2022-03-20 12:40:0213#include <__config>
Mark de Wevere5d2d3e2022-03-20 12:40:0214
Nikolas Klauserc6f3b7b2024-11-06 09:39:1915#if _LIBCPP_HAS_LOCALIZATION
Louis Dionne87d56c52024-09-16 12:15:3816
17# include <__chrono/calendar.h>
18# include <__chrono/day.h>
19# include <__chrono/duration.h>
20# include <__chrono/file_clock.h>
Mark de Wevercf509362025-02-21 16:50:0121# include <__chrono/gps_clock.h>
Louis Dionne87d56c52024-09-16 12:15:3822# include <__chrono/hh_mm_ss.h>
23# include <__chrono/local_info.h>
24# include <__chrono/month.h>
25# include <__chrono/month_weekday.h>
26# include <__chrono/monthday.h>
27# include <__chrono/statically_widen.h>
28# include <__chrono/sys_info.h>
29# include <__chrono/system_clock.h>
Mark de Weveraca829d2025-02-06 16:55:0230# include <__chrono/tai_clock.h>
Mark de Wever0cd794d2025-01-24 17:56:0231# include <__chrono/utc_clock.h>
Louis Dionne87d56c52024-09-16 12:15:3832# include <__chrono/weekday.h>
33# include <__chrono/year.h>
34# include <__chrono/year_month.h>
35# include <__chrono/year_month_day.h>
36# include <__chrono/year_month_weekday.h>
37# include <__chrono/zoned_time.h>
38# include <__concepts/same_as.h>
39# include <__format/format_functions.h>
40# include <__fwd/ostream.h>
41# include <ratio>
Louis Dionne09e3a362024-09-16 19:06:2042# include <sstream>
Louis Dionne87d56c52024-09-16 12:15:3843
44# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
45# pragma GCC system_header
46# endif
Mark de Wevere5d2d3e2022-03-20 12:40:0247
48_LIBCPP_BEGIN_NAMESPACE_STD
49
Louis Dionne87d56c52024-09-16 12:15:3850# if _LIBCPP_STD_VER >= 20
Mark de Wevere5d2d3e2022-03-20 12:40:0251
52namespace chrono {
53
Mark de Wever2c1d7952022-03-20 12:40:0254template <class _CharT, class _Traits, class _Duration>
Mark de Wever042a6a12024-01-22 18:06:1555 requires(!treat_as_floating_point_v<typename _Duration::rep> && _Duration{1} < days{1})
Mark de Wever2c1d7952022-03-20 12:40:0256_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever042a6a12024-01-22 18:06:1557operator<<(basic_ostream<_CharT, _Traits>& __os, const sys_time<_Duration>& __tp) {
Mark de Wever2c1d7952022-03-20 12:40:0258 return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%F %T}"), __tp);
59}
60
Mark de Wever042a6a12024-01-22 18:06:1561template <class _CharT, class _Traits>
62_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
63operator<<(basic_ostream<_CharT, _Traits>& __os, const sys_days& __dp) {
64 return __os << year_month_day{__dp};
65}
66
Mark de Wever0cd794d2025-01-24 17:56:0267# if _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM
Mark de Wever3b30f202025-01-24 19:23:1868# if _LIBCPP_HAS_EXPERIMENTAL_TZDB
Mark de Wever0cd794d2025-01-24 17:56:0269
70template <class _CharT, class _Traits, class _Duration>
71_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
72operator<<(basic_ostream<_CharT, _Traits>& __os, const utc_time<_Duration>& __tp) {
73 return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%F %T}"), __tp);
74}
75
Mark de Weveraca829d2025-02-06 16:55:0276template <class _CharT, class _Traits, class _Duration>
77_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
78operator<<(basic_ostream<_CharT, _Traits>& __os, const tai_time<_Duration>& __tp) {
79 return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%F %T}"), __tp);
80}
81
Mark de Wevercf509362025-02-21 16:50:0182template <class _CharT, class _Traits, class _Duration>
83_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
84operator<<(basic_ostream<_CharT, _Traits>& __os, const gps_time<_Duration>& __tp) {
85 return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%F %T}"), __tp);
86}
87
Mark de Wever3b30f202025-01-24 19:23:1888# endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB
Mark de Wever0cd794d2025-01-24 17:56:0289# endif // _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM
90
Mark de Wever96f30332023-04-20 19:40:3691template <class _CharT, class _Traits, class _Duration>
92_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
93operator<<(basic_ostream<_CharT, _Traits>& __os, const file_time<_Duration> __tp) {
94 return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%F %T}"), __tp);
95}
96
Mark de Weverbc2cf422023-04-28 06:13:0197template <class _CharT, class _Traits, class _Duration>
98_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
99operator<<(basic_ostream<_CharT, _Traits>& __os, const local_time<_Duration> __tp) {
100 return __os << sys_time<_Duration>{__tp.time_since_epoch()};
101}
102
Mark de Wever719c3dc2022-03-20 12:40:02103// Depending on the type the return is a const _CharT* or a basic_string<_CharT>
104template <class _CharT, class _Period>
105_LIBCPP_HIDE_FROM_ABI auto __units_suffix() {
106 // TODO FMT LWG issue the suffixes are always char and not STATICALLY-WIDEN'ed.
107 if constexpr (same_as<typename _Period::type, atto>)
108 return _LIBCPP_STATICALLY_WIDEN(_CharT, "as");
109 else if constexpr (same_as<typename _Period::type, femto>)
110 return _LIBCPP_STATICALLY_WIDEN(_CharT, "fs");
111 else if constexpr (same_as<typename _Period::type, pico>)
112 return _LIBCPP_STATICALLY_WIDEN(_CharT, "ps");
113 else if constexpr (same_as<typename _Period::type, nano>)
114 return _LIBCPP_STATICALLY_WIDEN(_CharT, "ns");
115 else if constexpr (same_as<typename _Period::type, micro>)
Nikolas Klauserc6f3b7b2024-11-06 09:39:19116# if _LIBCPP_HAS_UNICODE
Mark de Wever719c3dc2022-03-20 12:40:02117 return _LIBCPP_STATICALLY_WIDEN(_CharT, "\u00b5s");
Louis Dionne87d56c52024-09-16 12:15:38118# else
Mark de Wever719c3dc2022-03-20 12:40:02119 return _LIBCPP_STATICALLY_WIDEN(_CharT, "us");
Louis Dionne87d56c52024-09-16 12:15:38120# endif
Mark de Wever719c3dc2022-03-20 12:40:02121 else if constexpr (same_as<typename _Period::type, milli>)
122 return _LIBCPP_STATICALLY_WIDEN(_CharT, "ms");
123 else if constexpr (same_as<typename _Period::type, centi>)
124 return _LIBCPP_STATICALLY_WIDEN(_CharT, "cs");
125 else if constexpr (same_as<typename _Period::type, deci>)
126 return _LIBCPP_STATICALLY_WIDEN(_CharT, "ds");
127 else if constexpr (same_as<typename _Period::type, ratio<1>>)
128 return _LIBCPP_STATICALLY_WIDEN(_CharT, "s");
129 else if constexpr (same_as<typename _Period::type, deca>)
130 return _LIBCPP_STATICALLY_WIDEN(_CharT, "das");
131 else if constexpr (same_as<typename _Period::type, hecto>)
132 return _LIBCPP_STATICALLY_WIDEN(_CharT, "hs");
133 else if constexpr (same_as<typename _Period::type, kilo>)
134 return _LIBCPP_STATICALLY_WIDEN(_CharT, "ks");
135 else if constexpr (same_as<typename _Period::type, mega>)
136 return _LIBCPP_STATICALLY_WIDEN(_CharT, "Ms");
137 else if constexpr (same_as<typename _Period::type, giga>)
138 return _LIBCPP_STATICALLY_WIDEN(_CharT, "Gs");
139 else if constexpr (same_as<typename _Period::type, tera>)
140 return _LIBCPP_STATICALLY_WIDEN(_CharT, "Ts");
141 else if constexpr (same_as<typename _Period::type, peta>)
142 return _LIBCPP_STATICALLY_WIDEN(_CharT, "Ps");
143 else if constexpr (same_as<typename _Period::type, exa>)
144 return _LIBCPP_STATICALLY_WIDEN(_CharT, "Es");
145 else if constexpr (same_as<typename _Period::type, ratio<60>>)
146 return _LIBCPP_STATICALLY_WIDEN(_CharT, "min");
147 else if constexpr (same_as<typename _Period::type, ratio<3600>>)
148 return _LIBCPP_STATICALLY_WIDEN(_CharT, "h");
149 else if constexpr (same_as<typename _Period::type, ratio<86400>>)
150 return _LIBCPP_STATICALLY_WIDEN(_CharT, "d");
151 else if constexpr (_Period::den == 1)
152 return std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "[{}]s"), _Period::num);
153 else
154 return std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "[{}/{}]s"), _Period::num, _Period::den);
155}
156
157template <class _CharT, class _Traits, class _Rep, class _Period>
Louis Dionne3d334df2023-03-16 17:09:44158_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever719c3dc2022-03-20 12:40:02159operator<<(basic_ostream<_CharT, _Traits>& __os, const duration<_Rep, _Period>& __d) {
160 basic_ostringstream<_CharT, _Traits> __s;
161 __s.flags(__os.flags());
162 __s.imbue(__os.getloc());
163 __s.precision(__os.precision());
164 __s << __d.count() << chrono::__units_suffix<_CharT, _Period>();
165 return __os << __s.str();
166}
167
Mark de Wevere5d2d3e2022-03-20 12:40:02168template <class _CharT, class _Traits>
Louis Dionne3d334df2023-03-16 17:09:44169_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const day& __d) {
Mark de Weverde6827b2023-02-24 20:35:41170 return __os << (__d.ok() ? std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%d}"), __d)
171 // Note this error differs from the wording of the Standard. The
172 // Standard wording doesn't work well on AIX or Windows. There
173 // the formatted day seems to be either modulo 100 or completely
174 // omitted. Judging by the wording this is valid.
175 // TODO FMT Write a paper of file an LWG issue.
176 : std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:02} is not a valid day"),
177 static_cast<unsigned>(__d)));
Mark de Wevere5d2d3e2022-03-20 12:40:02178}
179
Mark de Wever3eb4f162022-03-20 12:40:02180template <class _CharT, class _Traits>
Louis Dionne3d334df2023-03-16 17:09:44181_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever1522f192022-03-20 12:40:02182operator<<(basic_ostream<_CharT, _Traits>& __os, const month& __m) {
183 return __os << (__m.ok() ? std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%b}"), __m)
184 : std::format(__os.getloc(),
185 _LIBCPP_STATICALLY_WIDEN(_CharT, "{} is not a valid month"),
186 static_cast<unsigned>(__m))); // TODO FMT Standard mandated locale isn't used.
187}
188
189template <class _CharT, class _Traits>
Louis Dionne3d334df2023-03-16 17:09:44190_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever3eb4f162022-03-20 12:40:02191operator<<(basic_ostream<_CharT, _Traits>& __os, const year& __y) {
192 return __os << (__y.ok() ? std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%Y}"), __y)
193 : std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%Y} is not a valid year"), __y));
194}
195
Mark de Wever566868c2022-03-20 12:40:02196template <class _CharT, class _Traits>
Louis Dionne3d334df2023-03-16 17:09:44197_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever566868c2022-03-20 12:40:02198operator<<(basic_ostream<_CharT, _Traits>& __os, const weekday& __wd) {
199 return __os << (__wd.ok() ? std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%a}"), __wd)
200 : std::format(__os.getloc(), // TODO FMT Standard mandated locale isn't used.
201 _LIBCPP_STATICALLY_WIDEN(_CharT, "{} is not a valid weekday"),
202 static_cast<unsigned>(__wd.c_encoding())));
203}
204
Mark de Wever105fef52022-03-20 12:40:02205template <class _CharT, class _Traits>
Louis Dionne3d334df2023-03-16 17:09:44206_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever105fef52022-03-20 12:40:02207operator<<(basic_ostream<_CharT, _Traits>& __os, const weekday_indexed& __wdi) {
208 auto __i = __wdi.index();
209 return __os << (__i >= 1 && __i <= 5
210 ? std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L}[{}]"), __wdi.weekday(), __i)
211 : std::format(__os.getloc(),
212 _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L}[{} is not a valid index]"),
213 __wdi.weekday(),
214 __i));
215}
216
217template <class _CharT, class _Traits>
Louis Dionne3d334df2023-03-16 17:09:44218_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever105fef52022-03-20 12:40:02219operator<<(basic_ostream<_CharT, _Traits>& __os, const weekday_last& __wdl) {
220 return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L}[last]"), __wdl.weekday());
221}
222
223template <class _CharT, class _Traits>
Louis Dionne3d334df2023-03-16 17:09:44224_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever105fef52022-03-20 12:40:02225operator<<(basic_ostream<_CharT, _Traits>& __os, const month_day& __md) {
226 // TODO FMT The Standard allows 30th of February to be printed.
227 // It would be nice to show an error message instead.
228 return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L}/{}"), __md.month(), __md.day());
229}
230
231template <class _CharT, class _Traits>
Louis Dionne3d334df2023-03-16 17:09:44232_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever105fef52022-03-20 12:40:02233operator<<(basic_ostream<_CharT, _Traits>& __os, const month_day_last& __mdl) {
234 return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L}/last"), __mdl.month());
235}
236
237template <class _CharT, class _Traits>
Louis Dionne3d334df2023-03-16 17:09:44238_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever105fef52022-03-20 12:40:02239operator<<(basic_ostream<_CharT, _Traits>& __os, const month_weekday& __mwd) {
240 return __os << std::format(
241 __os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L}/{:L}"), __mwd.month(), __mwd.weekday_indexed());
242}
243
244template <class _CharT, class _Traits>
Louis Dionne3d334df2023-03-16 17:09:44245_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever105fef52022-03-20 12:40:02246operator<<(basic_ostream<_CharT, _Traits>& __os, const month_weekday_last& __mwdl) {
247 return __os << std::format(
248 __os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L}/{:L}"), __mwdl.month(), __mwdl.weekday_last());
249}
250
251template <class _CharT, class _Traits>
Louis Dionne3d334df2023-03-16 17:09:44252_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever105fef52022-03-20 12:40:02253operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month& __ym) {
254 return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{}/{:L}"), __ym.year(), __ym.month());
255}
256
257template <class _CharT, class _Traits>
Louis Dionne3d334df2023-03-16 17:09:44258_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever105fef52022-03-20 12:40:02259operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month_day& __ymd) {
260 return __os << (__ymd.ok() ? std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%F}"), __ymd)
261 : std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "{:%F} is not a valid date"), __ymd));
262}
263
264template <class _CharT, class _Traits>
Louis Dionne3d334df2023-03-16 17:09:44265_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever105fef52022-03-20 12:40:02266operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month_day_last& __ymdl) {
267 return __os << std::format(
268 __os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{}/{:L}"), __ymdl.year(), __ymdl.month_day_last());
269}
270
271template <class _CharT, class _Traits>
Louis Dionne3d334df2023-03-16 17:09:44272_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever105fef52022-03-20 12:40:02273operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month_weekday& __ymwd) {
274 return __os << std::format(
275 __os.getloc(),
276 _LIBCPP_STATICALLY_WIDEN(_CharT, "{}/{:L}/{:L}"),
277 __ymwd.year(),
278 __ymwd.month(),
279 __ymwd.weekday_indexed());
280}
281
282template <class _CharT, class _Traits>
Louis Dionne3d334df2023-03-16 17:09:44283_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever105fef52022-03-20 12:40:02284operator<<(basic_ostream<_CharT, _Traits>& __os, const year_month_weekday_last& __ymwdl) {
285 return __os << std::format(
286 __os.getloc(),
287 _LIBCPP_STATICALLY_WIDEN(_CharT, "{}/{:L}/{:L}"),
288 __ymwdl.year(),
289 __ymwdl.month(),
290 __ymwdl.weekday_last());
291}
292
Mark de Wever7f5d1302022-03-20 12:40:02293template <class _CharT, class _Traits, class _Duration>
Louis Dionne3d334df2023-03-16 17:09:44294_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
Mark de Wever7f5d1302022-03-20 12:40:02295operator<<(basic_ostream<_CharT, _Traits>& __os, const hh_mm_ss<_Duration> __hms) {
296 return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%T}"), __hms);
297}
298
Nikolas Klauser24e70e32025-01-24 08:34:42299# if _LIBCPP_HAS_EXPERIMENTAL_TZDB
Mark de Wever6f7976c2024-04-17 18:55:51300
301template <class _CharT, class _Traits>
302_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
303operator<<(basic_ostream<_CharT, _Traits>& __os, const sys_info& __info) {
304 // __info.abbrev is always std::basic_string<char>.
305 // Since these strings typically are short the conversion should be cheap.
306 std::basic_string<_CharT> __abbrev{__info.abbrev.begin(), __info.abbrev.end()};
307 return __os << std::format(
308 _LIBCPP_STATICALLY_WIDEN(_CharT, "[{:%F %T}, {:%F %T}) {:%T} {:%Q%q} \"{}\""),
309 __info.begin,
310 __info.end,
311 hh_mm_ss{__info.offset},
312 __info.save,
313 __abbrev);
314}
315
Mark de Wever8a21d592024-04-18 15:23:07316template <class _CharT, class _Traits>
317_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
318operator<<(basic_ostream<_CharT, _Traits>& __os, const local_info& __info) {
319 auto __result = [&]() -> basic_string<_CharT> {
320 switch (__info.result) {
321 case local_info::unique:
322 return _LIBCPP_STATICALLY_WIDEN(_CharT, "unique");
323 case local_info::nonexistent:
324 return _LIBCPP_STATICALLY_WIDEN(_CharT, "non-existent");
325 case local_info::ambiguous:
326 return _LIBCPP_STATICALLY_WIDEN(_CharT, "ambiguous");
327
328 default:
329 return std::format(_LIBCPP_STATICALLY_WIDEN(_CharT, "unspecified result ({})"), __info.result);
330 };
331 };
332
333 return __os << std::format(
334 _LIBCPP_STATICALLY_WIDEN(_CharT, "{}: {{{}, {}}}"), __result(), __info.first, __info.second);
335}
336
Nikolas Klauserc6f3b7b2024-11-06 09:39:19337# if _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM
Mark de Weverafbfb162024-07-20 17:24:41338template <class _CharT, class _Traits, class _Duration, class _TimeZonePtr>
339_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>&
340operator<<(basic_ostream<_CharT, _Traits>& __os, const zoned_time<_Duration, _TimeZonePtr>& __tp) {
341 return __os << std::format(__os.getloc(), _LIBCPP_STATICALLY_WIDEN(_CharT, "{:L%F %T %Z}"), __tp);
342}
Louis Dionne87d56c52024-09-16 12:15:38343# endif
Nikolas Klauser24e70e32025-01-24 08:34:42344# endif // _LIBCPP_HAS_EXPERIMENTAL_TZDB
Mark de Wever6f7976c2024-04-17 18:55:51345
Mark de Wevere5d2d3e2022-03-20 12:40:02346} // namespace chrono
347
Louis Dionne87d56c52024-09-16 12:15:38348# endif // if _LIBCPP_STD_VER >= 20
Mark de Wevere5d2d3e2022-03-20 12:40:02349
350_LIBCPP_END_NAMESPACE_STD
351
Nikolas Klauserc6f3b7b2024-11-06 09:39:19352#endif // _LIBCPP_HAS_LOCALIZATION
Louis Dionne87d56c52024-09-16 12:15:38353
Mark de Wevere5d2d3e2022-03-20 12:40:02354#endif // _LIBCPP___CHRONO_OSTREAM_H