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