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
@@ -1537,6 +1537,27 @@ class deque : protected deque_base<Allocator>
|
||||
this->members_.m_finish = this->members_.m_start;
|
||||
}
|
||||
|
||||
friend bool operator==(const deque& x, const deque& y)
|
||||
{ return x.size() == y.size() && std::equal(x.begin(), x.end(), y.begin()); }
|
||||
|
||||
friend bool operator!=(const deque& x, const deque& y)
|
||||
{ return !(x == y); }
|
||||
|
||||
friend bool operator<(const deque& x, const deque& y)
|
||||
{ return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); }
|
||||
|
||||
friend bool operator>(const deque& x, const deque& y)
|
||||
{ return y < x; }
|
||||
|
||||
friend bool operator>=(const deque& x, const deque& y)
|
||||
{ return !(x < y); }
|
||||
|
||||
friend bool operator<=(const deque& x, const deque& y)
|
||||
{ return !(y < x); }
|
||||
|
||||
friend void swap(deque& x, deque& y)
|
||||
{ x.swap(y); }
|
||||
|
||||
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||
private:
|
||||
|
||||
@@ -1939,39 +1960,6 @@ class deque : protected deque_base<Allocator>
|
||||
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||
};
|
||||
|
||||
// Nonmember functions.
|
||||
template <class T, class Allocator>
|
||||
inline bool operator==(const deque<T, Allocator>& x, const deque<T, Allocator>& y) BOOST_CONTAINER_NOEXCEPT
|
||||
{
|
||||
return x.size() == y.size() && equal(x.begin(), x.end(), y.begin());
|
||||
}
|
||||
|
||||
template <class T, class Allocator>
|
||||
inline bool operator<(const deque<T, Allocator>& x, const deque<T, Allocator>& y) BOOST_CONTAINER_NOEXCEPT
|
||||
{
|
||||
return lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
|
||||
}
|
||||
|
||||
template <class T, class Allocator>
|
||||
inline bool operator!=(const deque<T, Allocator>& x, const deque<T, Allocator>& y) BOOST_CONTAINER_NOEXCEPT
|
||||
{ return !(x == y); }
|
||||
|
||||
template <class T, class Allocator>
|
||||
inline bool operator>(const deque<T, Allocator>& x, const deque<T, Allocator>& y) BOOST_CONTAINER_NOEXCEPT
|
||||
{ return y < x; }
|
||||
|
||||
template <class T, class Allocator>
|
||||
inline bool operator>=(const deque<T, Allocator>& x, const deque<T, Allocator>& y) BOOST_CONTAINER_NOEXCEPT
|
||||
{ return !(x < y); }
|
||||
|
||||
template <class T, class Allocator>
|
||||
inline bool operator<=(const deque<T, Allocator>& x, const deque<T, Allocator>& y) BOOST_CONTAINER_NOEXCEPT
|
||||
{ return !(y < x); }
|
||||
|
||||
template <class T, class Allocator>
|
||||
inline void swap(deque<T, Allocator>& x, deque<T, Allocator>& y)
|
||||
{ x.swap(y); }
|
||||
|
||||
}}
|
||||
|
||||
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||
|
||||
Reference in new issue
Block a user