[libcxx-commits] [libcxx] [libc++][TZDB] Implements zoned_time formatters. (PR #98347)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 16 08:51:29 PDT 2024


================
@@ -517,6 +548,11 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool __date_ok(const _Tp& __value) {
     return true;
   else if constexpr (same_as<_Tp, chrono::local_info>)
     return true;
+#  endif
+#  if !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) &&                            \
+      !defined(_LIBCPP_HAS_NO_LOCALIZATION)
+  else if constexpr (__is_specialization_v<_Tp, chrono::zoned_time>)
+    return true;
 #  endif
----------------
ldionne wrote:

We could perhaps still provide `zoned_time` when the TZDB / localization / filesystem is disabled. It's not a very useful type without those other features, but whatever.

The benefit would be that we don't need any complexity here because the type doesn't exist.

https://github.com/llvm/llvm-project/pull/98347


More information about the libcxx-commits mailing list