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)
8 // For more information, see http://www.boost.org/libs/range/
11 #ifndef BOOST_RANGE_DETAIL_BEGIN_HPP
12 #define BOOST_RANGE_DETAIL_BEGIN_HPP
14 #include <boost/config.hpp> // BOOST_MSVC
15 #include <boost/detail/workaround.hpp>
16 #include <boost/range/iterator.hpp>
17 #include <boost/range/detail/common.hpp>
18 #if BOOST_WORKAROUND(BOOST_MSVC, < 1310)
19 # include <boost/range/value_type.hpp>
25 namespace range_detail
27 template< typename T >
30 //////////////////////////////////////////////////////////////////////
32 //////////////////////////////////////////////////////////////////////
35 struct range_begin<std_container_>
37 template< typename C >
38 static BOOST_RANGE_DEDUCED_TYPENAME range_iterator<C>::type fun( C& c )
44 //////////////////////////////////////////////////////////////////////
46 //////////////////////////////////////////////////////////////////////
49 struct range_begin<std_pair_>
51 template< typename P >
52 static BOOST_RANGE_DEDUCED_TYPENAME range_iterator<P>::type fun( const P& p )
58 //////////////////////////////////////////////////////////////////////
60 //////////////////////////////////////////////////////////////////////
63 struct range_begin<array_>
65 #if !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
66 template< typename T, std::size_t sz >
67 static T* fun( T BOOST_RANGE_ARRAY_REF()[sz] )
69 return boost_range_array;
73 static BOOST_RANGE_DEDUCED_TYPENAME range_value<T>::type* fun(T& t)
80 } // namespace 'range_detail'
82 namespace range_adl_barrier
84 template< typename C >
85 inline BOOST_RANGE_DEDUCED_TYPENAME range_iterator<C>::type
88 return range_detail::range_begin< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type >::fun( c );
91 } // namespace 'boost'