diff options
author | Remko Tronçon <git@el-tramo.be> | 2012-12-23 13:16:26 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2012-12-23 14:43:26 (GMT) |
commit | 491ddd570a752cf9bda85933bed0c6942e39b1f9 (patch) | |
tree | 10c25c1be8cc08d0497df1dccd56a10fbb30beee /3rdParty/Boost/src/boost/range/iterator_range_core.hpp | |
parent | da7d7a0ca71b80281aa9ff2526290b61ccb0cc60 (diff) | |
download | swift-491ddd570a752cf9bda85933bed0c6942e39b1f9.zip swift-491ddd570a752cf9bda85933bed0c6942e39b1f9.tar.bz2 |
Update Boost to 1.52.0.
Change-Id: I1e56bea2600bf2ed9c5b3aba8c4f9d2a0f350e77
Diffstat (limited to '3rdParty/Boost/src/boost/range/iterator_range_core.hpp')
-rw-r--r--[-rwxr-xr-x] | 3rdParty/Boost/src/boost/range/iterator_range_core.hpp | 102 |
1 files changed, 99 insertions, 3 deletions
diff --git a/3rdParty/Boost/src/boost/range/iterator_range_core.hpp b/3rdParty/Boost/src/boost/range/iterator_range_core.hpp index 7ef7523..60c7670 100755..100644 --- a/3rdParty/Boost/src/boost/range/iterator_range_core.hpp +++ b/3rdParty/Boost/src/boost/range/iterator_range_core.hpp @@ -53,13 +53,13 @@ namespace boost template< class ForwardRange > static IteratorT adl_begin( ForwardRange& r ) { - return IteratorT( boost::begin( r ) ); + return static_cast<IteratorT>( boost::begin( r ) ); } template< class ForwardRange > static IteratorT adl_end( ForwardRange& r ) { - return IteratorT( boost::end( r ) ); + return static_cast<IteratorT>( boost::end( r ) ); } }; @@ -71,6 +71,24 @@ namespace boost boost::begin(r), boost::end(r) ); } + + template< class Left, class Right > + inline bool greater_than( const Left& l, const Right& r ) + { + return less_than(r,l); + } + + template< class Left, class Right > + inline bool less_or_equal_than( const Left& l, const Right& r ) + { + return !iterator_range_detail::less_than(r,l); + } + + template< class Left, class Right > + inline bool greater_or_equal_than( const Left& l, const Right& r ) + { + return !iterator_range_detail::less_than(l,r); + } // This version is maintained since it is used in other boost libraries // such as Boost.Assign @@ -231,7 +249,7 @@ namespace boost difference_type size() const { - return m_End - m_Begin; + return m_End - m_Begin; } bool empty() const @@ -271,6 +289,21 @@ namespace boost { return iterator_range_detail::less_than( *this, r ); } + + bool operator>( const iterator_range& r ) const + { + return iterator_range_detail::greater_than( *this, r ); + } + + bool operator<=( const iterator_range& r ) const + { + return iterator_range_detail::less_or_equal_than( *this, r ); + } + + bool operator>=( const iterator_range& r ) const + { + return iterator_range_detail::greater_or_equal_than( *this, r ); + } #endif @@ -370,6 +403,27 @@ namespace boost { return iterator_range_detail::less_than( l, r ); } + + template< class IteratorT, class ForwardRange > + inline bool operator<=( const ForwardRange& l, + const iterator_range<IteratorT>& r ) + { + return iterator_range_detail::less_or_equal_than( l, r ); + } + + template< class IteratorT, class ForwardRange > + inline bool operator>( const ForwardRange& l, + const iterator_range<IteratorT>& r ) + { + return iterator_range_detail::greater_than( l, r ); + } + + template< class IteratorT, class ForwardRange > + inline bool operator>=( const ForwardRange& l, + const iterator_range<IteratorT>& r ) + { + return iterator_range_detail::greater_or_equal_than( l, r ); + } #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING #else @@ -416,6 +470,48 @@ namespace boost { return iterator_range_detail::less_than( l, r ); } + + template< class Iterator1T, class Iterator2T > + inline bool operator<=( const iterator_range<Iterator1T>& l, + const iterator_range<Iterator2T>& r ) + { + return iterator_range_detail::less_or_equal_than( l, r ); + } + + template< class IteratorT, class ForwardRange > + inline bool operator<=( const iterator_range<IteratorT>& l, + const ForwardRange& r ) + { + return iterator_range_detail::less_or_equal_than( l, r ); + } + + template< class Iterator1T, class Iterator2T > + inline bool operator>( const iterator_range<Iterator1T>& l, + const iterator_range<Iterator2T>& r ) + { + return iterator_range_detail::greater_than( l, r ); + } + + template< class IteratorT, class ForwardRange > + inline bool operator>( const iterator_range<IteratorT>& l, + const ForwardRange& r ) + { + return iterator_range_detail::greater_than( l, r ); + } + + template< class Iterator1T, class Iterator2T > + inline bool operator>=( const iterator_range<Iterator1T>& l, + const iterator_range<Iterator2T>& r ) + { + return iterator_range_detail::greater_or_equal_than( l, r ); + } + + template< class IteratorT, class ForwardRange > + inline bool operator>=( const iterator_range<IteratorT>& l, + const ForwardRange& r ) + { + return iterator_range_detail::greater_or_equal_than( l, r ); + } #endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING |