Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 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 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 11 | #ifndef NDNBOOST_RANGE_RBEGIN_HPP |
| 12 | #define NDNBOOST_RANGE_RBEGIN_HPP |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 13 | |
| 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) |
| 15 | # pragma once |
| 16 | #endif |
| 17 | |
| 18 | #include <ndnboost/range/end.hpp> |
| 19 | #include <ndnboost/range/reverse_iterator.hpp> |
| 20 | |
| 21 | namespace ndnboost |
| 22 | { |
| 23 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 24 | #ifdef NDNBOOST_NO_FUNCTION_TEMPLATE_ORDERING |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 25 | |
| 26 | template< class C > |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 27 | inline NDNBOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 28 | rbegin( C& c ) |
| 29 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 30 | return NDNBOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type( ndnboost::end( c ) ); |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | #else |
| 34 | |
| 35 | template< class C > |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 36 | inline NDNBOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 37 | rbegin( C& c ) |
| 38 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 39 | typedef NDNBOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 40 | iter_type; |
| 41 | return iter_type( ndnboost::end( c ) ); |
| 42 | } |
| 43 | |
| 44 | template< class C > |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 45 | inline NDNBOOST_DEDUCED_TYPENAME range_reverse_iterator<const C>::type |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 46 | rbegin( const C& c ) |
| 47 | { |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 48 | typedef NDNBOOST_DEDUCED_TYPENAME range_reverse_iterator<const C>::type |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 49 | iter_type; |
| 50 | return iter_type( ndnboost::end( c ) ); |
| 51 | } |
| 52 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 53 | #endif // NDNBOOST_NO_FUNCTION_TEMPLATE_ORDERING |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 54 | |
| 55 | template< class T > |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 56 | inline NDNBOOST_DEDUCED_TYPENAME range_reverse_iterator<const T>::type |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 57 | const_rbegin( const T& r ) |
| 58 | { |
| 59 | return ndnboost::rbegin( r ); |
| 60 | } |
| 61 | |
| 62 | } // namespace 'boost' |
| 63 | |
| 64 | #endif |
| 65 | |