annotate DEPENDENCIES/generic/include/boost/range/begin.hpp @ 125:34e428693f5d vext

Vext -> Repoint
author Chris Cannam
date Thu, 14 Jun 2018 11:15:39 +0100
parents c530137014c0
children
rev   line source
Chris@16 1 // Boost.Range library
Chris@16 2 //
Chris@16 3 // Copyright Thorsten Ottosen 2003-2004. Use, modification and
Chris@16 4 // distribution is subject to the Boost Software License, Version
Chris@16 5 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
Chris@16 6 // http://www.boost.org/LICENSE_1_0.txt)
Chris@16 7 //
Chris@16 8 // For more information, see http://www.boost.org/libs/range/
Chris@16 9 //
Chris@16 10
Chris@16 11 #ifndef BOOST_RANGE_BEGIN_HPP
Chris@16 12 #define BOOST_RANGE_BEGIN_HPP
Chris@16 13
Chris@101 14 #if defined(_MSC_VER)
Chris@16 15 # pragma once
Chris@16 16 #endif
Chris@16 17
Chris@16 18 #include <boost/range/config.hpp>
Chris@16 19
Chris@16 20 #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
Chris@16 21 #include <boost/range/detail/begin.hpp>
Chris@16 22 #else
Chris@16 23
Chris@16 24 #include <boost/range/iterator.hpp>
Chris@16 25
Chris@16 26 namespace boost
Chris@16 27 {
Chris@16 28
Chris@101 29 #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
Chris@16 30 namespace range_detail
Chris@16 31 {
Chris@16 32 #endif
Chris@16 33
Chris@16 34 //////////////////////////////////////////////////////////////////////
Chris@16 35 // primary template
Chris@16 36 //////////////////////////////////////////////////////////////////////
Chris@16 37
Chris@16 38 template< typename C >
Chris@16 39 inline BOOST_DEDUCED_TYPENAME range_iterator<C>::type
Chris@16 40 range_begin( C& c )
Chris@16 41 {
Chris@16 42 //
Chris@16 43 // If you get a compile-error here, it is most likely because
Chris@16 44 // you have not implemented range_begin() properly in
Chris@16 45 // the namespace of C
Chris@16 46 //
Chris@16 47 return c.begin();
Chris@16 48 }
Chris@16 49
Chris@16 50 //////////////////////////////////////////////////////////////////////
Chris@16 51 // pair
Chris@16 52 //////////////////////////////////////////////////////////////////////
Chris@16 53
Chris@16 54 template< typename Iterator >
Chris@16 55 inline Iterator range_begin( const std::pair<Iterator,Iterator>& p )
Chris@16 56 {
Chris@16 57 return p.first;
Chris@16 58 }
Chris@16 59
Chris@16 60 template< typename Iterator >
Chris@16 61 inline Iterator range_begin( std::pair<Iterator,Iterator>& p )
Chris@16 62 {
Chris@16 63 return p.first;
Chris@16 64 }
Chris@16 65
Chris@16 66 //////////////////////////////////////////////////////////////////////
Chris@16 67 // array
Chris@16 68 //////////////////////////////////////////////////////////////////////
Chris@16 69
Chris@16 70 //
Chris@16 71 // May this be discarded? Or is it needed for bad compilers?
Chris@16 72 //
Chris@16 73 template< typename T, std::size_t sz >
Chris@16 74 inline const T* range_begin( const T (&a)[sz] )
Chris@16 75 {
Chris@16 76 return a;
Chris@16 77 }
Chris@16 78
Chris@16 79 template< typename T, std::size_t sz >
Chris@16 80 inline T* range_begin( T (&a)[sz] )
Chris@16 81 {
Chris@16 82 return a;
Chris@16 83 }
Chris@16 84
Chris@16 85
Chris@101 86 #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
Chris@16 87 } // namespace 'range_detail'
Chris@16 88 #endif
Chris@16 89
Chris@16 90 // Use a ADL namespace barrier to avoid ambiguity with other unqualified
Chris@16 91 // calls. This is particularly important with C++0x encouraging
Chris@16 92 // unqualified calls to begin/end.
Chris@16 93 namespace range_adl_barrier
Chris@16 94 {
Chris@16 95
Chris@16 96 template< class T >
Chris@16 97 inline BOOST_DEDUCED_TYPENAME range_iterator<T>::type begin( T& r )
Chris@16 98 {
Chris@101 99 #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
Chris@16 100 using namespace range_detail;
Chris@16 101 #endif
Chris@16 102 return range_begin( r );
Chris@16 103 }
Chris@16 104
Chris@16 105 template< class T >
Chris@16 106 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type begin( const T& r )
Chris@16 107 {
Chris@101 108 #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
Chris@16 109 using namespace range_detail;
Chris@16 110 #endif
Chris@16 111 return range_begin( r );
Chris@16 112 }
Chris@16 113
Chris@16 114 } // namespace range_adl_barrier
Chris@16 115 } // namespace boost
Chris@16 116
Chris@16 117 #endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
Chris@16 118
Chris@16 119 namespace boost
Chris@16 120 {
Chris@16 121 namespace range_adl_barrier
Chris@16 122 {
Chris@16 123 template< class T >
Chris@16 124 inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type
Chris@16 125 const_begin( const T& r )
Chris@16 126 {
Chris@16 127 return boost::range_adl_barrier::begin( r );
Chris@16 128 }
Chris@16 129 } // namespace range_adl_barrier
Chris@16 130
Chris@16 131 using namespace range_adl_barrier;
Chris@16 132 } // namespace boost
Chris@16 133
Chris@16 134 #endif
Chris@16 135