[libcxx-commits] [libcxx] [libc++] Implement P2538R1 "ADL-proof std::projected" (PR #65411)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 6 06:04:19 PDT 2023


================
@@ -80,3 +80,11 @@ struct BadPredicate6 {
     bool operator()(std::iter_common_reference_t<It1>, std::iter_common_reference_t<It2>) const = delete;
 };
 static_assert(!std::indirect_binary_predicate<BadPredicate6, It1, It2>);
+
+// Test ADL-proofing (P2538R1)
+#if TEST_STD_VER >= 26
----------------
ldionne wrote:

Good catch with the `test_macros.h`.

> Why are we not testing this in older dialectts?

This is technically a C++26 paper, so I was going to test this only in C++26. The fact that it happens to pass in C++20/23 is just because we will implement `projected` the same in all standard modes, but we're not technically guaranteeing that `projected` is ADL-proof in older standards. Does that make sense?

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


More information about the libcxx-commits mailing list