- Add configuration options to vector

- Cleanup tree configuration options
This commit is contained in:
Ion Gaztañaga committed 2017-12-10 23:33:41 +01:00
1 parent 82abe673fc
commit 2802a1f50d
26 files changed
+1122 -511

No files matched your search

+6 -15
View File
@@ -33,6 +33,7 @@
#include <boost/container/detail/mpl.hpp>
#include <boost/container/detail/node_alloc_holder.hpp>
#include <boost/container/detail/version_type.hpp>
#include <boost/container/detail/value_functors.hpp>
// move
#include <boost/move/utility_core.hpp>
#include <boost/move/iterator.hpp>
@@ -1204,7 +1205,7 @@ class list
//! <b>Note</b>: The relative order of elements that are not removed is unchanged,
//! and iterators to elements that are not removed remain valid.
void unique()
{ this->unique(value_equal()); }
{ this->unique(value_equal_t()); }
//! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
//! elements that satisfy some binary predicate from the list.
@@ -1234,7 +1235,7 @@ class list
//! <b>Complexity</b>: This function is linear time: it performs at most
//! size() + x.size() - 1 comparisons.
void merge(list &x)
{ this->merge(x, value_less()); }
{ this->merge(x, value_less_t()); }
//! <b>Requires</b>: The lists x and *this must be distinct.
//!
@@ -1300,7 +1301,7 @@ class list
//! <b>Complexity</b>: The number of comparisons is approximately N log N, where N
//! is the list's size.
void sort()
{ this->sort(value_less()); }
{ this->sort(value_less_t()); }
//! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
//! The sort is stable, that is, the relative order of equivalent elements is preserved.
@@ -1457,18 +1458,8 @@ class list
}
};
//Functors for member algorithm defaults
struct value_less
{
bool operator()(const value_type &a, const value_type &b) const
{ return a < b; }
};
struct value_equal
{
bool operator()(const value_type &a, const value_type &b) const
{ return a == b; }
};
typedef value_less<value_type> value_less_t;
typedef value_equal<value_type> value_equal_t;
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
};