[libcxx-commits] [libcxx] [libc++] Implement LWG4257: Stream insertion for chrono local_time should be constrained (PR #230811)

Hristo Hristov via libcxx-commits libcxx-commits at lists.llvm.org
Sun Oct 11 21:57:59 PDT 2026


================
@@ -215,8 +216,38 @@ static void test_ja_JP() {
              std::chrono::duration<long long, std::ratio<1, 100>>{12'345'678'9010}}) == SV("2009-02-13 23:31:30.10"));
 }
 
+template <class CharT, class T>
+concept is_ostreamable = requires(std::basic_ostream<CharT>& os, T const& val) {
+  { os << val };
+};
+
 template <class CharT>
 static void test() {
+  // Test local_time's constraints:
----------------
Zingam wrote:

@frederick-vs-ja We usually test contraints/SFINAE first. So I think it's better to move these test cases in test_constrains() at the top and call it from main() WDYT?

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


More information about the libcxx-commits mailing list