[12] | 1 | // Boost.Range library |
---|
| 2 | // |
---|
| 3 | // Copyright Thorsten Ottosen 2003-2004. Use, modification and |
---|
| 4 | // distribution is subject to the Boost Software License, Version |
---|
| 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
---|
| 6 | // http://www.boost.org/LICENSE_1_0.txt) |
---|
| 7 | // |
---|
| 8 | // For more information, see http://www.boost.org/libs/range/ |
---|
| 9 | // |
---|
| 10 | |
---|
| 11 | #ifndef BOOST_RANGE_REND_HPP |
---|
| 12 | #define BOOST_RANGE_REND_HPP |
---|
| 13 | |
---|
| 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) |
---|
| 15 | # pragma once |
---|
| 16 | #endif |
---|
| 17 | |
---|
| 18 | #include <boost/range/begin.hpp> |
---|
| 19 | #include <boost/range/reverse_result_iterator.hpp> |
---|
| 20 | #include <boost/range/reverse_iterator.hpp> |
---|
| 21 | #include <boost/range/const_reverse_iterator.hpp> |
---|
| 22 | |
---|
| 23 | namespace boost |
---|
| 24 | { |
---|
| 25 | |
---|
| 26 | #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING |
---|
| 27 | |
---|
| 28 | template< class C > |
---|
| 29 | inline BOOST_DEDUCED_TYPENAME range_reverse_result_iterator<C>::type |
---|
| 30 | rend( C& c ) |
---|
| 31 | { |
---|
| 32 | return BOOST_DEDUCED_TYPENAME range_reverse_result_iterator<C>::type( begin( c ) ); |
---|
| 33 | } |
---|
| 34 | |
---|
| 35 | #else |
---|
| 36 | |
---|
| 37 | template< class C > |
---|
| 38 | inline BOOST_DEDUCED_TYPENAME range_reverse_iterator< |
---|
| 39 | typename remove_const<C>::type >::type |
---|
| 40 | rend( C& c ) |
---|
| 41 | { |
---|
| 42 | typedef BOOST_DEDUCED_TYPENAME range_reverse_iterator< |
---|
| 43 | typename remove_const<C>::type >::type |
---|
| 44 | iter_type; |
---|
| 45 | return iter_type( begin( c ) ); |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | template< class C > |
---|
| 49 | inline BOOST_DEDUCED_TYPENAME range_const_reverse_iterator<C>::type |
---|
| 50 | rend( const C& c ) |
---|
| 51 | { |
---|
| 52 | typedef BOOST_DEDUCED_TYPENAME range_const_reverse_iterator<C>::type |
---|
| 53 | iter_type; |
---|
| 54 | return iter_type( begin( c ) ); |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | #endif |
---|
| 58 | |
---|
| 59 | template< class T > |
---|
| 60 | inline BOOST_DEDUCED_TYPENAME range_const_reverse_iterator<T>::type |
---|
| 61 | const_rend( const T& r ) |
---|
| 62 | { |
---|
| 63 | return rend( r ); |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | } // namespace 'boost' |
---|
| 67 | |
---|
| 68 | #endif |
---|