From f8968ab022ca1ac055b7643ee0f8498928dd1dad Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 25 Aug 2012 21:54:18 +0000 Subject: [PATCH] Unordered: Better swap assertion. [SVN r80224] --- include/boost/unordered/detail/table.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/boost/unordered/detail/table.hpp b/include/boost/unordered/detail/table.hpp index cbf62195..116c4e9c 100644 --- a/include/boost/unordered/detail/table.hpp +++ b/include/boost/unordered/detail/table.hpp @@ -310,6 +310,11 @@ namespace boost { namespace unordered { namespace detail { template void swap(table& x, Propagate p) { + // According to 23.2.1.8, if propagate_on_container_swap is + // false the behaviour is undefined unless the allocators + // are equal. + BOOST_ASSERT(p.value || this->node_alloc() == x.node_alloc()); + boost::unordered::detail::set_hash_functions op1(*this, x); boost::unordered::detail::set_hash_functions