[libcxx-commits] [libcxx] [libc++] Move allocator assertion into allocator_traits (PR #94750)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 14 08:08:56 PDT 2024


================
@@ -477,9 +477,8 @@ public:
   using reverse_iterator       = std::reverse_iterator<iterator>;
   using const_reverse_iterator = std::reverse_iterator<const_iterator>;
 
-  static_assert(is_same<allocator_type, __rebind_alloc<__alloc_traits, value_type> >::value,
-                "[allocator.requirements] states that rebinding an allocator to the same type should result in the "
-                "original allocator");
+  static_assert(__check_valid_allocator<allocator_type>::value, "");
+  
----------------
ldionne wrote:

I would suggest moving this up, closer to where we define `allocator_type`.

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


More information about the libcxx-commits mailing list