forked from boostorg/container
- Modified relational operators to be friend inline definitions. This allows compilation checking when instantiating classes, avoids predeclarations and results in less verbose code.
- First to make associative containers' tree implementation configurable.
This commit is contained in:
1 parent
f2947c115e
commit
41c2056ec6
62 files changed
+17386
-834
No files matched your search
@@ -1580,11 +1580,33 @@ class vector
|
||||
|
||||
//Absolutely experimental. This function might change, disappear or simply crash!
|
||||
template<class BiDirPosConstIt, class BiDirSkipConstIt, class BiDirValueIt>
|
||||
void insert_ordered_at(size_type element_count, BiDirPosConstIt last_position_it, BiDirSkipConstIt last_skip_it, BiDirValueIt last_value_it)
|
||||
void insert_ordered_at( size_type element_count, BiDirPosConstIt last_position_it
|
||||
, BiDirSkipConstIt last_skip_it, BiDirValueIt last_value_it)
|
||||
{
|
||||
this->priv_insert_ordered_at(element_count, last_position_it, true, last_skip_it, last_value_it);
|
||||
}
|
||||
|
||||
friend bool operator==(const vector& x, const vector& y)
|
||||
{ return x.size() == y.size() && std::equal(x.begin(), x.end(), y.begin()); }
|
||||
|
||||
friend bool operator!=(const vector& x, const vector& y)
|
||||
{ return !(x == y); }
|
||||
|
||||
friend bool operator<(const vector& x, const vector& y)
|
||||
{ return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); }
|
||||
|
||||
friend bool operator>(const vector& x, const vector& y)
|
||||
{ return y < x; }
|
||||
|
||||
friend bool operator<=(const vector& x, const vector& y)
|
||||
{ return !(y < x); }
|
||||
|
||||
friend bool operator>=(const vector& x, const vector& y)
|
||||
{ return !(x < y); }
|
||||
|
||||
friend void swap(vector& x, vector& y)
|
||||
{ x.swap(y); }
|
||||
|
||||
private:
|
||||
|
||||
template<class OtherAllocator, class AllocVersion>
|
||||
@@ -1907,7 +1929,6 @@ class vector
|
||||
return iterator(this->m_holder.start() + n_pos);
|
||||
}
|
||||
|
||||
|
||||
template <class InsertionProxy>
|
||||
iterator priv_forward_range_insert_no_capacity
|
||||
(const pointer &pos, const size_type n, const InsertionProxy insert_range_proxy, allocator_v2)
|
||||
@@ -2635,33 +2656,6 @@ class vector
|
||||
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||
};
|
||||
|
||||
template <class T, class Allocator>
|
||||
inline bool
|
||||
operator==(const vector<T, Allocator>& x, const vector<T, Allocator>& y)
|
||||
{
|
||||
//Check first size and each element if needed
|
||||
return x.size() == y.size() && std::equal(x.begin(), x.end(), y.begin());
|
||||
}
|
||||
|
||||
template <class T, class Allocator>
|
||||
inline bool
|
||||
operator!=(const vector<T, Allocator>& x, const vector<T, Allocator>& y)
|
||||
{
|
||||
//Check first size and each element if needed
|
||||
return x.size() != y.size() || !std::equal(x.begin(), x.end(), y.begin());
|
||||
}
|
||||
|
||||
template <class T, class Allocator>
|
||||
inline bool
|
||||
operator<(const vector<T, Allocator>& x, const vector<T, Allocator>& y)
|
||||
{
|
||||
return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
|
||||
}
|
||||
|
||||
template <class T, class Allocator>
|
||||
inline void swap(vector<T, Allocator>& x, vector<T, Allocator>& y)
|
||||
{ x.swap(y); }
|
||||
|
||||
}}
|
||||
|
||||
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||
|
||||
Reference in new issue
Block a user