[libcxx-commits] [libcxx] [libc++] LWG3260: year_month* arithmetic rejects durations convertible to years (PR #196384)
Hristo Hristov via libcxx-commits
libcxx-commits at lists.llvm.org
Sat May 9 06:15:52 PDT 2026
================
@@ -17,13 +17,16 @@
#include <cassert>
#include <type_traits>
#include <utility>
+#include <ratio>
#include "test_macros.h"
using month = std::chrono::month;
using months = std::chrono::months;
using year = std::chrono::year;
+using years = std::chrono::years;
using year_month = std::chrono::year_month;
+using decamonths = std::chrono::duration<int, std::ratio_multiply<std::ratio<10>, months::period>>;
----------------
Zingam wrote:
You are using this in a single place, so it's better to declare it wherever you use it (easier to read).
Also bellow.
https://github.com/llvm/llvm-project/pull/196384
More information about the libcxx-commits
mailing list