|
18 | 18 | #include <__chrono/duration.h>
|
19 | 19 | #include <__chrono/file_clock.h>
|
20 | 20 | #include <__chrono/hh_mm_ss.h>
|
| 21 | +#include <__chrono/local_info.h> |
21 | 22 | #include <__chrono/month.h>
|
22 | 23 | #include <__chrono/month_weekday.h>
|
23 | 24 | #include <__chrono/monthday.h>
|
@@ -420,6 +421,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __weekday_ok(const _Tp& __value) {
|
420 | 421 | # if !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB)
|
421 | 422 | else if constexpr (same_as<_Tp, chrono::sys_info>)
|
422 | 423 | return true;
|
| 424 | + else if constexpr (same_as<_Tp, chrono::local_info>) |
| 425 | + return true; |
423 | 426 | # endif
|
424 | 427 | else
|
425 | 428 | static_assert(sizeof(_Tp) == 0, "Add the missing type specialization");
|
@@ -464,6 +467,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __weekday_name_ok(const _Tp& __value) {
|
464 | 467 | # if !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB)
|
465 | 468 | else if constexpr (same_as<_Tp, chrono::sys_info>)
|
466 | 469 | return true;
|
| 470 | + else if constexpr (same_as<_Tp, chrono::local_info>) |
| 471 | + return true; |
467 | 472 | # endif
|
468 | 473 | else
|
469 | 474 | static_assert(sizeof(_Tp) == 0, "Add the missing type specialization");
|
@@ -508,6 +513,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __date_ok(const _Tp& __value) {
|
508 | 513 | # if !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB)
|
509 | 514 | else if constexpr (same_as<_Tp, chrono::sys_info>)
|
510 | 515 | return true;
|
| 516 | + else if constexpr (same_as<_Tp, chrono::local_info>) |
| 517 | + return true; |
511 | 518 | # endif
|
512 | 519 | else
|
513 | 520 | static_assert(sizeof(_Tp) == 0, "Add the missing type specialization");
|
@@ -552,6 +559,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __month_name_ok(const _Tp& __value) {
|
552 | 559 | # if !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB)
|
553 | 560 | else if constexpr (same_as<_Tp, chrono::sys_info>)
|
554 | 561 | return true;
|
| 562 | + else if constexpr (same_as<_Tp, chrono::local_info>) |
| 563 | + return true; |
555 | 564 | # endif
|
556 | 565 | else
|
557 | 566 | static_assert(sizeof(_Tp) == 0, "Add the missing type specialization");
|
@@ -894,6 +903,17 @@ struct formatter<chrono::sys_info, _CharT> : public __formatter_chrono<_CharT> {
|
894 | 903 | return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags::__time_zone);
|
895 | 904 | }
|
896 | 905 | };
|
| 906 | + |
| 907 | +template <__fmt_char_type _CharT> |
| 908 | +struct formatter<chrono::local_info, _CharT> : public __formatter_chrono<_CharT> { |
| 909 | +public: |
| 910 | + using _Base = __formatter_chrono<_CharT>; |
| 911 | + |
| 912 | + template <class _ParseContext> |
| 913 | + _LIBCPP_HIDE_FROM_ABI constexpr typename _ParseContext::iterator parse(_ParseContext& __ctx) { |
| 914 | + return _Base::__parse(__ctx, __format_spec::__fields_chrono, __format_spec::__flags{}); |
| 915 | + } |
| 916 | +}; |
897 | 917 | # endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB)
|
898 | 918 |
|
899 | 919 | #endif // if _LIBCPP_STD_VER >= 20
|
|
0 commit comments