diff --git a/include/atomic_queue/atomic_queue.h b/include/atomic_queue/atomic_queue.h index 94d7a56..6c04e03 100644 --- a/include/atomic_queue/atomic_queue.h +++ b/include/atomic_queue/atomic_queue.h @@ -464,6 +464,7 @@ class AtomicQueueB : private std::allocator_traits::template rebind_alloc{NIL}.is_lock_free()); // Queue element type T is not atomic. Use AtomicQueue2/AtomicQueueB2 for such element types. for(auto p = elements_, q = elements_ + size_; p < q; ++p) p->store(NIL, X); + assert(get_allocator() == allocator); // The standard requires the original and rebound allocators to manage the same state. } AtomicQueueB(AtomicQueueB&& b) noexcept @@ -484,7 +485,7 @@ class AtomicQueueB : private std::allocator_traits::template rebind_alloc::template rebind_allocstore(Base::EMPTY, X); A a = get_allocator(); + assert(a == allocator); // The standard requires stateful and rebound allocators to manage the same state. for(auto p = elements_, q = elements_ + size_; p < q; ++p) std::allocator_traits::construct(a, p); } @@ -592,7 +594,7 @@ class AtomicQueueB2 : private std::allocator_traits::template rebind_alloc