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)
15# pragma once
16#endif
17
18#include <boost/range/begin.hpp>
19#include <boost/range/reverse_iterator.hpp>
20
21namespace boost
22{
23
24template< class C >
25inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type
26rend( C& c )
27{
28 typedef BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type
29 iter_type;
30 return iter_type( boost::begin( c ) );
31}
32
33template< class C >
34inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<const C>::type
35rend( const C& c )
36{
37 typedef BOOST_DEDUCED_TYPENAME range_reverse_iterator<const C>::type
38 iter_type;
39 return iter_type( boost::begin( c ) );
40}
41
42template< class T >
43inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<const T>::type
44const_rend( const T& r )
45{
46 return boost::rend( r );
47}
48
49} // namespace 'boost'
50
51#endif
52
53

source code of include/boost/range/rend.hpp