Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
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_IMPLEMENTATION_HELP_HPP
12 #define BOOST_RANGE_DETAIL_IMPLEMENTATION_HELP_HPP
14 #include <boost/range/config.hpp>
15 #include <boost/range/detail/common.hpp>
16 #include <boost/type_traits/is_same.hpp>
20 #ifndef BOOST_NO_CWCHAR
26 namespace range_detail
29 /////////////////////////////////////////////////////////////////////
31 /////////////////////////////////////////////////////////////////////
33 inline const char* str_end( const char* s, const char* )
35 return s + strlen( s );
38 #ifndef BOOST_NO_CWCHAR
39 inline const wchar_t* str_end( const wchar_t* s, const wchar_t* )
41 return s + wcslen( s );
44 inline const wchar_t* str_end( const wchar_t* s, const wchar_t* )
46 if( s == 0 || s[0] == 0 )
54 template< class Char >
55 inline Char* str_end( Char* s )
57 return const_cast<Char*>( str_end( s, s ) );
60 template< class T, std::size_t sz >
61 inline T* array_end( T BOOST_RANGE_ARRAY_REF()[sz], int )
63 return boost_range_array + sz;
66 template< class T, std::size_t sz >
67 inline const T* array_end( const T BOOST_RANGE_ARRAY_REF()[sz], int )
69 return boost_range_array + sz;
72 template< class T, std::size_t sz >
73 inline T* array_end( T BOOST_RANGE_ARRAY_REF()[sz], char_or_wchar_t_array_tag )
75 return boost_range_array + sz - 1;
78 template< class T, std::size_t sz >
79 inline const T* array_end( const T BOOST_RANGE_ARRAY_REF()[sz], char_or_wchar_t_array_tag )
81 return boost_range_array + sz - 1;
84 template< class T, std::size_t sz >
85 inline T* array_end( T BOOST_RANGE_ARRAY_REF()[sz] )
87 typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< is_same<char,T>::value || is_same<wchar_t,T>::value,
88 char_or_wchar_t_array_tag,
91 return array_end<T,sz>( boost_range_array, tag() );
94 template< class T, std::size_t sz >
95 inline const T* array_end( const T BOOST_RANGE_ARRAY_REF()[sz] )
97 typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< is_same<char,T>::value || is_same<wchar_t,T>::value,
98 char_or_wchar_t_array_tag,
101 return array_end<T,sz>( boost_range_array, tag() );
104 /////////////////////////////////////////////////////////////////////
106 /////////////////////////////////////////////////////////////////////
108 template< class Char >
109 inline std::size_t str_size( const Char* const& s )
111 return str_end( s ) - s;
114 template< class T, std::size_t sz >
115 inline std::size_t array_size( T BOOST_RANGE_ARRAY_REF()[sz], int )
120 template< class T, std::size_t sz >
121 inline std::size_t array_size( const T BOOST_RANGE_ARRAY_REF()[sz], int )
126 template< class T, std::size_t sz >
127 inline std::size_t array_size( T BOOST_RANGE_ARRAY_REF()[sz], char_or_wchar_t_array_tag )
132 template< class T, std::size_t sz >
133 inline std::size_t array_size( const T BOOST_RANGE_ARRAY_REF()[sz], char_or_wchar_t_array_tag )
138 template< class T, std::size_t sz >
139 inline std::size_t array_size( T BOOST_RANGE_ARRAY_REF()[sz] )
141 typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< is_same<const char,T>::value || is_same<const wchar_t,T>::value ||
142 is_same<char,T>::value || is_same<wchar_t,T>::value,
143 char_or_wchar_t_array_tag,
145 return array_size<T,sz>( boost_range_array, tag() );
148 template< class T, std::size_t sz >
149 inline std::size_t array_size( const T BOOST_RANGE_ARRAY_REF()[sz] )
151 typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< is_same<char,T>::value || is_same<wchar_t,T>::value,
152 char_or_wchar_t_array_tag,
154 return array_size<T,sz>( boost_range_array, tag() );
157 } // namespace 'range_detail'
159 } // namespace 'boost'