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