15 changes: 11 additions & 4 deletions include/boost/intrusive/sgtree.hpp
Expand Up @@ -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)
{}

Expand Down Expand Up @@ -934,8 +938,11 @@ class sgtree
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::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)
{}

Expand Down
18 changes: 16 additions & 2 deletions include/boost/intrusive/slist.hpp
Expand Up @@ -307,7 +307,17 @@ class slist_impl
//!
//! <b>Throws</b>: 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(); }

//! <b>Effects</b>: constructs an empty list.
//!
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: 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(); }

Expand Down Expand Up @@ -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)
{}

Expand Down
30 changes: 22 additions & 8 deletions include/boost/intrusive/splay_set.hpp
Expand Up @@ -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)
{}

Expand Down Expand Up @@ -497,8 +501,11 @@ class splay_set
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::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)
{}

Expand Down Expand Up @@ -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)
{}

Expand Down Expand Up @@ -973,8 +984,11 @@ class splay_multiset
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::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)
{}

Expand Down
15 changes: 11 additions & 4 deletions include/boost/intrusive/splaytree.hpp
Expand Up @@ -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)
{}

Expand Down Expand Up @@ -584,8 +588,11 @@ class splaytree
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::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)
{}

Expand Down
18 changes: 16 additions & 2 deletions include/boost/intrusive/treap.hpp
Expand Up @@ -159,7 +159,18 @@ class treap_impl
//! <b>Throws</b>: 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())
{}

//! <b>Effects</b>: Constructs an empty container.
//!
//! <b>Complexity</b>: Constant.
//!
//! <b>Throws</b>: 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)
Expand Down Expand Up @@ -1147,8 +1158,11 @@ class treap

//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::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)
Expand Down
77 changes: 31 additions & 46 deletions include/boost/intrusive/treap_set.hpp
Expand Up @@ -83,31 +83,19 @@ class treap_set_impl
static const bool constant_time_size = implementation_defined::constant_time_size;

public:
//! <b>Effects</b>: Constructs an empty treap_set.
//!
//! <b>Complexity</b>: Constant.
//!
//! <b>Throws</b>: 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)
{}

//! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
//! cmp must be a comparison function that induces a strict weak ordering.
//!
//! <b>Effects</b>: Constructs an empty treap_set and inserts elements from
//! [b, e).
//!
//! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise N * log N, where N is distance(last, first).
//!
//! <b>Throws</b>: 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<class Iterator>
treap_set_impl( Iterator b, Iterator e
, const key_compare &cmp = key_compare()
Expand Down Expand Up @@ -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<iterator,iterator> 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<class KeyType, class KeyTypeKeyCompare>
std::pair<iterator,iterator> 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<const_iterator, const_iterator>
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<class KeyType, class KeyTypeKeyCompare>
std::pair<const_iterator, const_iterator>
equal_range(const KeyType& key, KeyTypeKeyCompare comp) const
Expand Down Expand Up @@ -508,7 +496,11 @@ class treap_set
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::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)
Expand Down Expand Up @@ -608,31 +600,20 @@ class treap_multiset_impl
static const bool constant_time_size = implementation_defined::constant_time_size;

public:
//! <b>Effects</b>: Constructs an empty treap_multiset.
//!
//! <b>Complexity</b>: Constant.
//!
//! <b>Throws</b>: 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)
{}

//! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
//! cmp must be a comparison function that induces a strict weak ordering.
//!
//! <b>Effects</b>: Constructs an empty treap_multiset and inserts elements from
//! [b, e).
//!
//! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
//! comp and otherwise N * log N, where N is distance(last, first).
//!
//! <b>Throws</b>: 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<class Iterator>
treap_multiset_impl( Iterator b, Iterator e
, const key_compare &cmp = key_compare()
Expand Down Expand Up @@ -1000,7 +981,11 @@ class treap_multiset
//Assert if passed value traits are compatible with the type
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::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)
Expand Down