Update contrib.
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/result_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_result_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_result_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 //////////////////////////////////////////////////////////////////////
82 //////////////////////////////////////////////////////////////////////
85 struct range_begin<char_ptr_>
87 static char* fun( char* s )
94 struct range_begin<const_char_ptr_>
96 static const char* fun( const char* s )
103 struct range_begin<wchar_t_ptr_>
106 static wchar_t* fun( wchar_t* s )
113 struct range_begin<const_wchar_t_ptr_>
115 static const wchar_t* fun( const wchar_t* s )
121 } // namespace 'range_detail'
123 template< typename C >
124 inline BOOST_RANGE_DEDUCED_TYPENAME range_result_iterator<C>::type
127 return range_detail::range_begin< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type >::fun( c );
130 } // namespace 'boost'