[libcxx-commits] [libcxx] [libc++][memory_resource] Implements LWG3683. (PR #100775)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jul 27 00:26:38 PDT 2024


================
@@ -174,6 +174,17 @@ class _LIBCPP_AVAILABILITY_PMR _LIBCPP_TEMPLATE_VIS polymorphic_allocator {
 
   _LIBCPP_HIDE_FROM_ABI memory_resource* resource() const noexcept { return __res_; }
 
+  friend bool operator==(const polymorphic_allocator& __lhs, const polymorphic_allocator& __rhs) noexcept {
+    return *__lhs.resource() == *__rhs.resource();
+  }
+
+#  if _LIBCPP_STD_VER == 17
----------------
philnik777 wrote:

```suggestion
#  if _LIBCPP_STD_VER <= 17
```
I find the current version quite confusing at first glance, since we don't do that usually.

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


More information about the libcxx-commits mailing list