Fixed ticket #12761 ("intrusive::set::swap doesn't swap the comparison function")

This commit is contained in:
Ion Gaztañaga
2017-03-02 08:29:55 +01:00
parent 95bba145ea
commit 6510ac498e
3 changed files with 3 additions and 2 deletions

View File

@@ -3869,6 +3869,7 @@ to be inserted in intrusive containers are allocated using `std::vector` or `std
* Fixed bugs:
* [@https://svn.boost.org/trac/boost/ticket/12745 Boost Trac #12745: ['key_nodeptr_comp broken if the key type is void*]]
* [@https://svn.boost.org/trac/boost/ticket/12761 Boost Trac #12761: ['intrusive::set::swap doesn't swap the comparison function*]]
[endsect]

View File

@@ -967,7 +967,7 @@ class bstree_impl
void swap(bstree_impl& other)
{
//This can throw
::boost::adl_move_swap(this->comp(), this->comp());
::boost::adl_move_swap(this->comp(), other->comp());
//These can't throw
node_algorithms::swap_tree(this->header_ptr(), node_ptr(other.header_ptr()));
this->sz_traits().swap(other.sz_traits());

View File

@@ -354,9 +354,9 @@ class treap_impl
//! <b>Throws</b>: If the comparison functor's swap call throws.
void swap(treap_impl& other)
{
tree_type::swap(other);
//This can throw
::boost::adl_move_swap(this->priv_pcomp(), other.priv_pcomp());
tree_type::swap(other);
}
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.