From 6510ac498e0f9e54bf2a962a703352dac54158d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Thu, 2 Mar 2017 08:29:55 +0100 Subject: [PATCH] Fixed ticket #12761 ("intrusive::set::swap doesn't swap the comparison function") --- doc/intrusive.qbk | 1 + include/boost/intrusive/bstree.hpp | 2 +- include/boost/intrusive/treap.hpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/intrusive.qbk b/doc/intrusive.qbk index 99a68f6..88dfc50 100644 --- a/doc/intrusive.qbk +++ b/doc/intrusive.qbk @@ -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] diff --git a/include/boost/intrusive/bstree.hpp b/include/boost/intrusive/bstree.hpp index f2cdb42..8c31582 100644 --- a/include/boost/intrusive/bstree.hpp +++ b/include/boost/intrusive/bstree.hpp @@ -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()); diff --git a/include/boost/intrusive/treap.hpp b/include/boost/intrusive/treap.hpp index 8567072..c6f63ff 100644 --- a/include/boost/intrusive/treap.hpp +++ b/include/boost/intrusive/treap.hpp @@ -354,9 +354,9 @@ class treap_impl //! Throws: 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); } //! Requires: Disposer::operator()(pointer) shouldn't throw.