source: NonGTP/Boost/boost/range/rbegin.hpp @ 857

Revision 857, 1.8 KB checked in by igarcia, 18 years ago (diff)
Line 
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_RBEGIN_HPP
12#define BOOST_RANGE_RBEGIN_HPP
13
14#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15# pragma once
16#endif
17
18#include <boost/range/end.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
23namespace boost
24{
25
26#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
27
28template< class C >
29inline BOOST_DEDUCED_TYPENAME range_reverse_result_iterator<C>::type
30rbegin( C& c )
31{
32    return BOOST_DEDUCED_TYPENAME range_reverse_result_iterator<C>::type( end( c ) );
33}
34
35#else
36
37template< class C >
38inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<
39                                                                typename remove_const<C>::type >::type
40rbegin( 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( end( c ) );
46}
47
48template< class C >
49inline BOOST_DEDUCED_TYPENAME range_const_reverse_iterator<C>::type
50rbegin( const C& c )
51{
52    typedef BOOST_DEDUCED_TYPENAME range_const_reverse_iterator<C>::type
53        iter_type;
54    return iter_type( end( c ) );
55}
56
57#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
58
59template< class T >
60inline BOOST_DEDUCED_TYPENAME range_const_reverse_iterator<T>::type
61const_rbegin( const T& r )
62{
63    return rbegin( r );
64}
65
66} // namespace 'boost'
67
68#endif
Note: See TracBrowser for help on using the repository browser.