[libcxx-commits] [libcxx] [libc++] Use __alloc_traits in <deque> whenever it is available for consistency (PR #126595)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 19 09:21:25 PDT 2025


================
@@ -61,7 +61,7 @@ public:
     deque& operator=(deque&& c)
         noexcept((__alloc_traits::propagate_on_container_move_assignment::value &&
                   is_nothrow_move_assignable<allocator_type>::value) ||
-                 allocator_traits<allocator_type>::is_always_equal::value);
+                 __alloc_traits::is_always_equal::value);
----------------
ldionne wrote:

I would actually keep using `allocator_traits<allocator_type>` in the synopsis (but I would do so consistently) since `__alloc_traits` is not defined in the synopsis. So I'd change to

```
 noexcept((allocator_traits<allocator_type>::propagate_on_container_move_assignment::value &&
                   is_nothrow_move_assignable<allocator_type>::value) ||
                  allocator_traits<allocator_type>::is_always_equal::value);
```

However, in the code below I'd use `__alloc_traits` consistently.

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


More information about the libcxx-commits mailing list