From 1c59efae73a3b3f2ee45e94c36b6a5561f237220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Fri, 26 Feb 2016 23:08:21 +0100 Subject: [PATCH] Fixes Boost Trac #11865: "Intrusive list explicit ctor error with Clang 3.6 (C++11/14)" --- doc/intrusive.qbk | 1 + include/boost/intrusive/avl_set.hpp | 30 ++++++++--- include/boost/intrusive/avltree.hpp | 14 +++-- include/boost/intrusive/bs_set.hpp | 30 ++++++++--- include/boost/intrusive/bstree.hpp | 21 ++++++-- include/boost/intrusive/list.hpp | 21 +++++++- include/boost/intrusive/rbtree.hpp | 15 ++++-- include/boost/intrusive/set.hpp | 30 ++++++++--- include/boost/intrusive/sg_set.hpp | 30 ++++++++--- include/boost/intrusive/sgtree.hpp | 15 ++++-- include/boost/intrusive/slist.hpp | 18 ++++++- include/boost/intrusive/splay_set.hpp | 30 ++++++++--- include/boost/intrusive/splaytree.hpp | 15 ++++-- include/boost/intrusive/treap.hpp | 18 ++++++- include/boost/intrusive/treap_set.hpp | 77 +++++++++++---------------- 15 files changed, 253 insertions(+), 112 deletions(-) diff --git a/doc/intrusive.qbk b/doc/intrusive.qbk index edcb9ec..111370c 100644 --- a/doc/intrusive.qbk +++ b/doc/intrusive.qbk @@ -3839,6 +3839,7 @@ to be inserted in intrusive containers are allocated using `std::vector` or `std * Fixed bugs: * [@https://svn.boost.org/trac/boost/ticket/11832 Boost Trac #11832: ['clang-cl + boost intrusive = miscompile]] + * [@https://svn.boost.org/trac/boost/ticket/11865 Boost Trac #11865: ['Intrusive list explicit ctor error with Clang 3.6 (C++11/14)]] [endsect] diff --git a/include/boost/intrusive/avl_set.hpp b/include/boost/intrusive/avl_set.hpp index 5c51e59..8f7139a 100644 --- a/include/boost/intrusive/avl_set.hpp +++ b/include/boost/intrusive/avl_set.hpp @@ -82,9 +82,13 @@ class avl_set_impl public: + //! @copydoc ::boost::intrusive::avltree::avltree() + avl_set_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::avltree::avltree(const key_compare &,const value_traits &) - explicit avl_set_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit avl_set_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -476,8 +480,11 @@ class avl_set //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit avl_set( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + avl_set() + : Base() + {} + + explicit avl_set( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} @@ -573,9 +580,13 @@ class avl_multiset_impl static const bool constant_time_size = tree_type::constant_time_size; public: + //! @copydoc ::boost::intrusive::avltree::avltree() + avl_multiset_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::avltree::avltree(const key_compare &,const value_traits &) - explicit avl_multiset_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit avl_multiset_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -936,8 +947,11 @@ class avl_multiset //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit avl_multiset( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + avl_multiset() + : Base() + {} + + explicit avl_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} diff --git a/include/boost/intrusive/avltree.hpp b/include/boost/intrusive/avltree.hpp index 8462293..37e3859 100644 --- a/include/boost/intrusive/avltree.hpp +++ b/include/boost/intrusive/avltree.hpp @@ -121,10 +121,13 @@ class avltree_impl typedef typename implementation_defined::insert_commit_data insert_commit_data; + //! @copydoc ::boost::intrusive::bstree::bstree() + avltree_impl() + : tree_type() + {} //! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &) - explicit avltree_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit avltree_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -507,8 +510,11 @@ class avltree //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit avltree( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + avltree() + : Base() + {} + + explicit avltree( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} diff --git a/include/boost/intrusive/bs_set.hpp b/include/boost/intrusive/bs_set.hpp index 2f560f5..798ffa6 100644 --- a/include/boost/intrusive/bs_set.hpp +++ b/include/boost/intrusive/bs_set.hpp @@ -80,9 +80,13 @@ class bs_set_impl static const bool constant_time_size = tree_type::constant_time_size; public: + //! @copydoc ::boost::intrusive::bstree::bstree() + bs_set_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &) - explicit bs_set_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit bs_set_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -473,8 +477,11 @@ class bs_set //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit bs_set( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + bs_set() + : Base() + {} + + explicit bs_set( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} @@ -569,9 +576,13 @@ class bs_multiset_impl static const bool constant_time_size = tree_type::constant_time_size; public: + //! @copydoc ::boost::intrusive::bstree::bstree() + bs_multiset_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &) - explicit bs_multiset_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit bs_multiset_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -932,8 +943,11 @@ class bs_multiset //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit bs_multiset( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + bs_multiset() + : Base() + {} + + explicit bs_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} diff --git a/include/boost/intrusive/bstree.hpp b/include/boost/intrusive/bstree.hpp index b08c49b..147d7e6 100644 --- a/include/boost/intrusive/bstree.hpp +++ b/include/boost/intrusive/bstree.hpp @@ -679,8 +679,18 @@ class bstree_impl //! Throws: If value_traits::node_traits::node //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) //! or the copy constructor of the key_compare object throws. Basic guarantee. - explicit bstree_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + bstree_impl() + : data_type(key_compare(), value_traits()) + {} + + //! Effects: Constructs an empty container with given comparison and traits. + //! + //! Complexity: Constant. + //! + //! Throws: If value_traits::node_traits::node + //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) + //! or the copy constructor of the key_compare object throws. Basic guarantee. + explicit bstree_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : data_type(cmp, v_traits) {} @@ -2052,8 +2062,11 @@ class bstree //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - bstree( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + bstree() + : Base() + {} + + explicit bstree( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} diff --git a/include/boost/intrusive/list.hpp b/include/boost/intrusive/list.hpp index cc6d73b..a59734a 100644 --- a/include/boost/intrusive/list.hpp +++ b/include/boost/intrusive/list.hpp @@ -176,7 +176,20 @@ class list_impl //! //! Throws: If value_traits::node_traits::node //! constructor throws (this does not happen with predefined Boost.Intrusive hooks). - explicit list_impl(const value_traits &v_traits = value_traits()) + list_impl() + : data_(value_traits()) + { + this->priv_size_traits().set_size(size_type(0)); + node_algorithms::init_header(this->get_root_node()); + } + + //! Effects: constructs an empty list. + //! + //! Complexity: Constant + //! + //! Throws: If value_traits::node_traits::node + //! constructor throws (this does not happen with predefined Boost.Intrusive hooks). + explicit list_impl(const value_traits &v_traits) : data_(v_traits) { this->priv_size_traits().set_size(size_type(0)); @@ -1455,7 +1468,11 @@ class list typedef typename Base::iterator iterator; typedef typename Base::const_iterator const_iterator; - explicit list(const value_traits &v_traits = value_traits()) + list() + : Base() + {} + + explicit list(const value_traits &v_traits) : Base(v_traits) {} diff --git a/include/boost/intrusive/rbtree.hpp b/include/boost/intrusive/rbtree.hpp index f3afd01..0bcb9cf 100644 --- a/include/boost/intrusive/rbtree.hpp +++ b/include/boost/intrusive/rbtree.hpp @@ -121,9 +121,13 @@ class rbtree_impl typedef typename implementation_defined::insert_commit_data insert_commit_data; + //! @copydoc ::boost::intrusive::bstree::bstree() + rbtree_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &) - explicit rbtree_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit rbtree_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -509,8 +513,11 @@ class rbtree //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit rbtree( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + rbtree() + : Base() + {} + + explicit rbtree( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} diff --git a/include/boost/intrusive/set.hpp b/include/boost/intrusive/set.hpp index f0072ea..a7d2b70 100644 --- a/include/boost/intrusive/set.hpp +++ b/include/boost/intrusive/set.hpp @@ -83,9 +83,13 @@ class set_impl static const bool constant_time_size = tree_type::constant_time_size; public: + //! @copydoc ::boost::intrusive::rbtree::rbtree() + set_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::rbtree::rbtree(const key_compare &,const value_traits &) - explicit set_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit set_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -476,8 +480,11 @@ class set //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit set( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + set() + : Base() + {} + + explicit set( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} @@ -573,9 +580,13 @@ class multiset_impl static const bool constant_time_size = tree_type::constant_time_size; public: + //! @copydoc ::boost::intrusive::rbtree::rbtree() + multiset_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::rbtree::rbtree(const key_compare &,const value_traits &) - explicit multiset_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit multiset_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -936,8 +947,11 @@ class multiset //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - multiset( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + multiset() + : Base() + {} + + explicit multiset( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} diff --git a/include/boost/intrusive/sg_set.hpp b/include/boost/intrusive/sg_set.hpp index e6d4e37..c5aca1e 100644 --- a/include/boost/intrusive/sg_set.hpp +++ b/include/boost/intrusive/sg_set.hpp @@ -81,9 +81,13 @@ class sg_set_impl static const bool constant_time_size = tree_type::constant_time_size; public: + //! @copydoc ::boost::intrusive::sgtree::sgtree() + sg_set_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::sgtree::sgtree(const key_compare &,const value_traits &) - explicit sg_set_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit sg_set_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -487,8 +491,11 @@ class sg_set //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit sg_set( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + sg_set() + : Base() + {} + + explicit sg_set( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} @@ -584,9 +591,13 @@ class sg_multiset_impl static const bool constant_time_size = tree_type::constant_time_size; public: + //! @copydoc ::boost::intrusive::sgtree::sgtree() + sg_multiset_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::sgtree::sgtree(const key_compare &,const value_traits &) - explicit sg_multiset_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit sg_multiset_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -960,8 +971,11 @@ class sg_multiset //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - sg_multiset( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + sg_multiset() + : Base() + {} + + explicit sg_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} diff --git a/include/boost/intrusive/sgtree.hpp b/include/boost/intrusive/sgtree.hpp index b4c4cde..678a421 100644 --- a/include/boost/intrusive/sgtree.hpp +++ b/include/boost/intrusive/sgtree.hpp @@ -281,9 +281,13 @@ class sgtree_impl typedef BOOST_INTRUSIVE_IMPDEF(typename node_algorithms::insert_commit_data) insert_commit_data; + //! @copydoc ::boost::intrusive::bstree::bstree() + sgtree_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &) - explicit sgtree_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit sgtree_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -934,8 +938,11 @@ class sgtree //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit sgtree( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + sgtree() + : Base() + {} + + explicit sgtree(const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} diff --git a/include/boost/intrusive/slist.hpp b/include/boost/intrusive/slist.hpp index dd3a05f..d64bf49 100644 --- a/include/boost/intrusive/slist.hpp +++ b/include/boost/intrusive/slist.hpp @@ -307,7 +307,17 @@ class slist_impl //! //! Throws: If value_traits::node_traits::node //! constructor throws (this does not happen with predefined Boost.Intrusive hooks). - explicit slist_impl(const value_traits &v_traits = value_traits()) + slist_impl() + : data_(value_traits()) + { this->set_default_constructed_state(); } + + //! Effects: constructs an empty list. + //! + //! Complexity: Constant + //! + //! Throws: If value_traits::node_traits::node + //! constructor throws (this does not happen with predefined Boost.Intrusive hooks). + explicit slist_impl(const value_traits &v_traits) : data_(v_traits) { this->set_default_constructed_state(); } @@ -2190,7 +2200,11 @@ class slist typedef typename Base::size_type size_type; typedef typename Base::node_ptr node_ptr; - explicit slist(const value_traits &v_traits = value_traits()) + slist() + : Base() + {} + + explicit slist(const value_traits &v_traits) : Base(v_traits) {} diff --git a/include/boost/intrusive/splay_set.hpp b/include/boost/intrusive/splay_set.hpp index 3d43215..ee2467d 100644 --- a/include/boost/intrusive/splay_set.hpp +++ b/include/boost/intrusive/splay_set.hpp @@ -81,9 +81,13 @@ class splay_set_impl static const bool constant_time_size = tree_type::constant_time_size; public: + //! @copydoc ::boost::intrusive::splaytree::splaytree() + splay_set_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::splaytree::splaytree(const key_compare &,const value_traits &) - explicit splay_set_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit splay_set_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -497,8 +501,11 @@ class splay_set //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit splay_set( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + splay_set() + : Base() + {} + + explicit splay_set( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} @@ -594,9 +601,13 @@ class splay_multiset_impl static const bool constant_time_size = tree_type::constant_time_size; public: + //! @copydoc ::boost::intrusive::splaytree::splaytree() + splay_multiset_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::splaytree::splaytree(const key_compare &,const value_traits &) - explicit splay_multiset_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit splay_multiset_impl(const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -973,8 +984,11 @@ class splay_multiset //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit splay_multiset( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + splay_multiset() + : Base() + {} + + explicit splay_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} diff --git a/include/boost/intrusive/splaytree.hpp b/include/boost/intrusive/splaytree.hpp index 27d75df..33ef2b1 100644 --- a/include/boost/intrusive/splaytree.hpp +++ b/include/boost/intrusive/splaytree.hpp @@ -111,9 +111,13 @@ class splaytree_impl typedef typename implementation_defined::insert_commit_data insert_commit_data; + //! @copydoc ::boost::intrusive::bstree::bstree() + splaytree_impl() + : tree_type() + {} + //! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &) - explicit splaytree_impl( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + explicit splaytree_impl( const key_compare &cmp, const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits) {} @@ -584,8 +588,11 @@ class splaytree //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit splaytree( const key_compare &cmp = key_compare() - , const value_traits &v_traits = value_traits()) + splaytree() + : Base() + {} + + explicit splaytree( const key_compare &cmp, const value_traits &v_traits = value_traits()) : Base(cmp, v_traits) {} diff --git a/include/boost/intrusive/treap.hpp b/include/boost/intrusive/treap.hpp index 52785da..f9d2e73 100644 --- a/include/boost/intrusive/treap.hpp +++ b/include/boost/intrusive/treap.hpp @@ -159,7 +159,18 @@ class treap_impl //! Throws: If value_traits::node_traits::node //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) //! or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. - explicit treap_impl( const key_compare &cmp = key_compare() + treap_impl() + : tree_type(), prio_base(priority_compare()) + {} + + //! Effects: Constructs an empty container. + //! + //! Complexity: Constant. + //! + //! Throws: If value_traits::node_traits::node + //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) + //! or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee. + explicit treap_impl( const key_compare &cmp , const priority_compare &pcmp = priority_compare() , const value_traits &v_traits = value_traits()) : tree_type(cmp, v_traits), prio_base(pcmp) @@ -1147,8 +1158,11 @@ class treap //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); + treap() + : Base() + {} - explicit treap( const key_compare &cmp = key_compare() + explicit treap( const key_compare &cmp , const priority_compare &pcmp = priority_compare() , const value_traits &v_traits = value_traits()) : Base(cmp, pcmp, v_traits) diff --git a/include/boost/intrusive/treap_set.hpp b/include/boost/intrusive/treap_set.hpp index 60cf449..4d26831 100644 --- a/include/boost/intrusive/treap_set.hpp +++ b/include/boost/intrusive/treap_set.hpp @@ -83,31 +83,19 @@ class treap_set_impl static const bool constant_time_size = implementation_defined::constant_time_size; public: - //! Effects: Constructs an empty treap_set. - //! - //! Complexity: Constant. - //! - //! Throws: If value_traits::node_traits::node - //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) - //! or the copy constructor of the key_compare object throws. - explicit treap_set_impl( const key_compare &cmp = key_compare() + //! @copydoc ::boost::intrusive::treap::treap() + treap_set_impl() + : tree_type() + {} + + //! @copydoc ::boost::intrusive::treap::treap(const key_compare &,const priority_compare &,const value_traits &) + explicit treap_set_impl( const key_compare &cmp , const priority_compare &pcmp = priority_compare() , const value_traits &v_traits = value_traits()) : tree_type(cmp, pcmp, v_traits) {} - //! Requires: Dereferencing iterator must yield an lvalue of type value_type. - //! cmp must be a comparison function that induces a strict weak ordering. - //! - //! Effects: Constructs an empty treap_set and inserts elements from - //! [b, e). - //! - //! Complexity: Linear in N if [b, e) is already sorted using - //! comp and otherwise N * log N, where N is distance(last, first). - //! - //! Throws: If value_traits::node_traits::node - //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) - //! or the copy constructor/operator() of the key_compare object throws. + //! @copydoc ::boost::intrusive::treap::treap(bool,Iterator,Iterator,const key_compare &,const priority_compare &,const value_traits &) template treap_set_impl( Iterator b, Iterator e , const key_compare &cmp = key_compare() @@ -368,21 +356,21 @@ class treap_set_impl #endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED - //! @copydoc ::boost::intrusive::rbtree::equal_range(const key_type &) + //! @copydoc ::boost::intrusive::treap::equal_range(const key_type &) std::pair equal_range(const key_type &key) { return this->tree_type::lower_bound_range(key); } - //! @copydoc ::boost::intrusive::rbtree::equal_range(const KeyType&,KeyTypeKeyCompare) + //! @copydoc ::boost::intrusive::treap::equal_range(const KeyType&,KeyTypeKeyCompare) template std::pair equal_range(const KeyType& key, KeyTypeKeyCompare comp) { return this->tree_type::equal_range(key, comp); } - //! @copydoc ::boost::intrusive::rbtree::equal_range(const key_type &)const + //! @copydoc ::boost::intrusive::treap::equal_range(const key_type &)const std::pair equal_range(const key_type &key) const { return this->tree_type::lower_bound_range(key); } - //! @copydoc ::boost::intrusive::rbtree::equal_range(const KeyType&,KeyTypeKeyCompare)const + //! @copydoc ::boost::intrusive::treap::equal_range(const KeyType&,KeyTypeKeyCompare)const template std::pair equal_range(const KeyType& key, KeyTypeKeyCompare comp) const @@ -508,7 +496,11 @@ class treap_set //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit treap_set( const key_compare &cmp = key_compare() + treap_set() + : Base() + {} + + explicit treap_set( const key_compare &cmp , const priority_compare &pcmp = priority_compare() , const value_traits &v_traits = value_traits()) : Base(cmp, pcmp, v_traits) @@ -608,31 +600,20 @@ class treap_multiset_impl static const bool constant_time_size = implementation_defined::constant_time_size; public: - //! Effects: Constructs an empty treap_multiset. - //! - //! Complexity: Constant. - //! - //! Throws: If value_traits::node_traits::node - //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) - //! or the copy constructor of the key_compare object throws. - explicit treap_multiset_impl( const key_compare &cmp = key_compare() + + //! @copydoc ::boost::intrusive::treap::treap() + treap_multiset_impl() + : tree_type() + {} + + //! @copydoc ::boost::intrusive::treap::treap(const key_compare &,const priority_compare &,const value_traits &) + explicit treap_multiset_impl( const key_compare &cmp , const priority_compare &pcmp = priority_compare() , const value_traits &v_traits = value_traits()) : tree_type(cmp, pcmp, v_traits) {} - //! Requires: Dereferencing iterator must yield an lvalue of type value_type. - //! cmp must be a comparison function that induces a strict weak ordering. - //! - //! Effects: Constructs an empty treap_multiset and inserts elements from - //! [b, e). - //! - //! Complexity: Linear in N if [b, e) is already sorted using - //! comp and otherwise N * log N, where N is distance(last, first). - //! - //! Throws: If value_traits::node_traits::node - //! constructor throws (this does not happen with predefined Boost.Intrusive hooks) - //! or the copy constructor/operator() of the key_compare object throws. + //! @copydoc ::boost::intrusive::treap::treap(bool,Iterator,Iterator,const key_compare &,const priority_compare &,const value_traits &) template treap_multiset_impl( Iterator b, Iterator e , const key_compare &cmp = key_compare() @@ -1000,7 +981,11 @@ class treap_multiset //Assert if passed value traits are compatible with the type BOOST_STATIC_ASSERT((detail::is_same::value)); - explicit treap_multiset( const key_compare &cmp = key_compare() + treap_multiset() + : Base() + {} + + explicit treap_multiset( const key_compare &cmp , const priority_compare &pcmp = priority_compare() , const value_traits &v_traits = value_traits()) : Base(cmp, pcmp, v_traits)