diff --git a/include/boost/range/begin.hpp b/include/boost/range/begin.hpp index e46c88f..ef8b8cf 100755 --- a/include/boost/range/begin.hpp +++ b/include/boost/range/begin.hpp @@ -84,22 +84,22 @@ namespace range_detail // string ////////////////////////////////////////////////////////////////////// - inline const char* begin( const char* s ) + inline const char* begin( const char*& s ) { return s; } - inline char* begin( char* s ) + inline char* begin( char*& s ) { return s; } - inline const wchar_t* begin( const wchar_t* s ) + inline const wchar_t* begin( const wchar_t*& s ) { return s; } - inline wchar_t* begin( wchar_t* s ) + inline wchar_t* begin( wchar_t*& s ) { return s; } diff --git a/include/boost/range/detail/implementation_help.hpp b/include/boost/range/detail/implementation_help.hpp index 8778b67..8cdf341 100755 --- a/include/boost/range/detail/implementation_help.hpp +++ b/include/boost/range/detail/implementation_help.hpp @@ -52,7 +52,7 @@ namespace boost #endif template< typename Char > - inline Char* str_end( Char* s ) + inline Char* str_end( Char* const& s ) { return (Char*)str_end( s, s ); } @@ -106,7 +106,7 @@ namespace boost ///////////////////////////////////////////////////////////////////// template< typename Char > - inline std::size_t str_size( const Char* s ) + inline std::size_t str_size( const Char* const& s ) { return str_end( s ) - s; } @@ -138,7 +138,8 @@ namespace boost template< typename T, std::size_t sz > inline std::size_t array_size( T BOOST_RANGE_ARRAY_REF()[sz] ) { - typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< is_same::value || is_same::value, + typedef BOOST_RANGE_DEDUCED_TYPENAME boost::mpl::if_c< is_same::value || is_same::value || + is_same::value || is_same::value, char_or_wchar_t_array_tag, int >::type tag; return array_size( array, tag() ); diff --git a/include/boost/range/detail/sfinae.hpp b/include/boost/range/detail/sfinae.hpp index 3085c27..5b2c61e 100755 --- a/include/boost/range/detail/sfinae.hpp +++ b/include/boost/range/detail/sfinae.hpp @@ -28,8 +28,8 @@ namespace boost // string ////////////////////////////////////////////////////////////////////// - yes_type is_string_impl( const char* ); - yes_type is_string_impl( const wchar_t* ); + yes_type is_string_impl( const char* const ); + yes_type is_string_impl( const wchar_t* const ); no_type is_string_impl( ... ); template< std::size_t sz > @@ -44,16 +44,16 @@ namespace boost yes_type is_wchar_t_array_impl( const wchar_t BOOST_RANGE_ARRAY_REF()[sz] ); no_type is_wchar_t_array_impl( ... ); - yes_type is_char_ptr_impl( char* ); + yes_type is_char_ptr_impl( char* const ); no_type is_char_ptr_impl( ... ); - yes_type is_const_char_ptr_impl( const char* ); + yes_type is_const_char_ptr_impl( const char* const ); no_type is_const_char_ptr_impl( ... ); - yes_type is_wchar_t_ptr_impl( wchar_t* ); + yes_type is_wchar_t_ptr_impl( wchar_t* const ); no_type is_wchar_t_ptr_impl( ... ); - yes_type is_const_wchar_t_ptr_impl( const wchar_t* ); + yes_type is_const_wchar_t_ptr_impl( const wchar_t* const ); no_type is_const_wchar_t_ptr_impl( ... ); ////////////////////////////////////////////////////////////////////// diff --git a/include/boost/range/empty.hpp b/include/boost/range/empty.hpp index c42bf6b..7363262 100755 --- a/include/boost/range/empty.hpp +++ b/include/boost/range/empty.hpp @@ -42,12 +42,12 @@ namespace range_detail // string ////////////////////////////////////////////////////////////////////// - inline bool empty( const char* s ) + inline bool empty( const char* const& s ) { return s == 0 || s[0] == 0; } - inline bool empty( const wchar_t* s ) + inline bool empty( const wchar_t* const& s ) { return s == 0 || s[0] == 0; } diff --git a/include/boost/range/end.hpp b/include/boost/range/end.hpp index 9759108..e588c0e 100755 --- a/include/boost/range/end.hpp +++ b/include/boost/range/end.hpp @@ -84,22 +84,22 @@ namespace range_detail // string ////////////////////////////////////////////////////////////////////// - inline char* end( char* s ) + inline char* end( char*& s ) { return range_detail::str_end( s ); } - inline wchar_t* end( wchar_t* s ) + inline wchar_t* end( wchar_t*& s ) { return range_detail::str_end( s ); } - inline const char* end( const char* s ) + inline const char* end( const char*& s ) { return range_detail::str_end( s ); } - inline const wchar_t* end( const wchar_t* s ) + inline const wchar_t* end( const wchar_t*& s ) { return range_detail::str_end( s ); } @@ -119,7 +119,7 @@ inline BOOST_DEDUCED_TYPENAME range_const_iterator::type end( const T& r ) } - +/* #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) // BCB is not able to overload pointer when class overloads are also available template<> @@ -135,7 +135,7 @@ inline range_const_iterator::type end( const wch } #endif - +*/ } // namespace 'boost' diff --git a/include/boost/range/iterator_range.hpp b/include/boost/range/iterator_range.hpp index 58fbf3f..431922f 100755 --- a/include/boost/range/iterator_range.hpp +++ b/include/boost/range/iterator_range.hpp @@ -225,10 +225,10 @@ namespace boost { return !operator==(r); } - bool operator<( const iterator_range& r ) const - { - return range_detail::less_than( *this, r ); - } + bool operator<( const iterator_range& r ) const + { + return range_detail::less_than( *this, r ); + } #endif diff --git a/include/boost/range/size.hpp b/include/boost/range/size.hpp index 6f6d500..0ba9345 100755 --- a/include/boost/range/size.hpp +++ b/include/boost/range/size.hpp @@ -73,12 +73,12 @@ namespace range_detail // string ////////////////////////////////////////////////////////////////////// - inline std::size_t size( const char*& s ) + inline std::size_t size( const char* const& s ) { return boost::range_detail::str_size( s ); } - inline std::size_t size( const wchar_t*& s ) + inline std::size_t size( const wchar_t* const& s ) { return boost::range_detail::str_size( s ); } @@ -91,21 +91,23 @@ inline BOOST_DEDUCED_TYPENAME range_size::type size( const T& r ) return range_detail::size( r ); } +/* #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) // BCB is not able to overload pointer when class overloads are also available template<> -inline range_size::type size( const char*& r ) +inline range_size::type size( const char* const& r ) { return range_detail::str_size( r ); } template<> -inline range_size::type size( const wchar_t*& r ) +inline range_size::type size( const wchar_t* const& r ) { return range_detail::str_size( r ); } #endif +*/ } // namespace 'boost'