[libcxx-commits] [libcxx] [libc++] Implement LWG4257: Stream insertion for chrono local_time should be constrained (PR #230811)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Oct 12 00:07:43 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:
----------------
frederick-vs-ja wrote:
I think it's more consistent to call it in `test`. As we're testing `char` and `wchar_t` versions, I think it's fine to introduce a function template for this.
https://github.com/llvm/llvm-project/pull/230811
More information about the libcxx-commits
mailing list