[libcxx-commits] [libcxx] [libc++][chrono] Implement LWG 4274: Allow chrono::hh_mm_ss to be constructed from unsigned durations (PR #209686)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 24 07:30:44 PDT 2026


================
@@ -45,6 +45,14 @@ class hh_mm_ss {
     return 0;
   }
 
+  _LIBCPP_HIDE_FROM_ABI static constexpr _Duration __abs_d(_Duration __d, bool __is_neg) {
+    if constexpr (is_unsigned_v<typename _Duration::rep>) {
+      return __d;
+    } else {
+      return __is_neg ? -__d : __d;
+    }
----------------
emmett2020 wrote:

Thanks, I fixed the format style.

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


More information about the libcxx-commits mailing list