diff --git a/include/boost/range/detail/begin.hpp b/include/boost/range/detail/begin.hpp index ab75dc1..f516a14 100755 --- a/include/boost/range/detail/begin.hpp +++ b/include/boost/range/detail/begin.hpp @@ -11,8 +11,13 @@ #ifndef BOOST_RANGE_DETAIL_BEGIN_HPP #define BOOST_RANGE_DETAIL_BEGIN_HPP +#include // BOOST_MSVC +#include #include #include +#if BOOST_WORKAROUND(BOOST_MSVC, < 1310) +# include +#endif namespace boost { @@ -57,11 +62,19 @@ namespace boost template<> struct range_begin { + #if !BOOST_WORKAROUND(BOOST_MSVC, < 1310) template< typename T, std::size_t sz > static T* fun( T BOOST_RANGE_ARRAY_REF()[sz] ) { return boost_range_array; } + #else + template + static BOOST_RANGE_DEDUCED_TYPENAME range_value::type* fun(T& t) + { + return t; + } + #endif }; ////////////////////////////////////////////////////////////////////// @@ -108,10 +121,10 @@ namespace boost } // namespace 'range_detail' template< typename C > - inline BOOST_DEDUCED_TYPENAME range_result_iterator::type + inline BOOST_RANGE_DEDUCED_TYPENAME range_result_iterator::type begin( C& c ) { - return range_detail::range_begin< BOOST_DEDUCED_TYPENAME range_detail::range::type >::fun( c ); + return range_detail::range_begin< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range::type >::fun( c ); } } // namespace 'boost' diff --git a/include/boost/range/detail/const_iterator.hpp b/include/boost/range/detail/const_iterator.hpp index 177f213..3aef82a 100755 --- a/include/boost/range/detail/const_iterator.hpp +++ b/include/boost/range/detail/const_iterator.hpp @@ -12,7 +12,7 @@ #define BOOST_RANGE_DETAIL_CONST_ITERATOR_HPP #include -#include +#include ////////////////////////////////////////////////////////////////////////////// // missing partial specialization workaround. @@ -31,7 +31,7 @@ namespace boost template< typename C > struct pts { - typedef BOOST_DEDUCED_TYPENAME C::const_iterator type; + typedef BOOST_RANGE_DEDUCED_TYPENAME C::const_iterator type; }; }; @@ -41,7 +41,7 @@ namespace boost template< typename P > struct pts { - typedef BOOST_DEDUCED_TYPENAME P::first_type type; + typedef BOOST_RANGE_DEDUCED_TYPENAME P::first_type type; }; }; @@ -53,7 +53,7 @@ namespace boost struct pts { typedef const BOOST_RANGE_DEDUCED_TYPENAME - remove_bounds::type* type; + remove_extent::type* type; }; }; @@ -64,7 +64,7 @@ namespace boost struct pts { typedef const BOOST_RANGE_DEDUCED_TYPENAME - remove_bounds::type* type; + remove_extent::type* type; }; }; diff --git a/include/boost/range/detail/end.hpp b/include/boost/range/detail/end.hpp index 783d5ce..410ae60 100755 --- a/include/boost/range/detail/end.hpp +++ b/include/boost/range/detail/end.hpp @@ -11,9 +11,19 @@ #ifndef BOOST_RANGE_DETAIL_END_HPP #define BOOST_RANGE_DETAIL_END_HPP -#include -#include -#include +#include // BOOST_MSVC +#include + +#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) +# include +#else +# include +# include +# include +# include +# if BOOST_WORKAROUND(BOOST_MSVC, < 1310) +# include +# endif namespace boost { @@ -59,11 +69,19 @@ namespace boost template<> struct range_end { + #if !BOOST_WORKAROUND(BOOST_MSVC, < 1310) template< typename T, std::size_t sz > static T* fun( T BOOST_RANGE_ARRAY_REF()[sz] ) { return boost::range_detail::array_end( boost_range_array ); } + #else + template + static BOOST_RANGE_DEDUCED_TYPENAME remove_extent::type* fun(T& t) + { + return t + remove_extent::size; + } + #endif }; @@ -131,13 +149,13 @@ namespace boost } // namespace 'range_detail' template< typename C > - inline BOOST_DEDUCED_TYPENAME range_result_iterator::type + inline BOOST_RANGE_DEDUCED_TYPENAME range_result_iterator::type end( C& c ) { - return range_detail::range_end< BOOST_DEDUCED_TYPENAME range_detail::range::type >::fun( c ); + return range_detail::range_end< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range::type >::fun( c ); } } // namespace 'boost' - +# endif // VC6 #endif diff --git a/include/boost/range/detail/size.hpp b/include/boost/range/detail/size.hpp index ae3aa47..fe52ba0 100755 --- a/include/boost/range/detail/size.hpp +++ b/include/boost/range/detail/size.hpp @@ -12,10 +12,18 @@ #ifndef BOOST_RANGE_DETAIL_SIZE_HPP #define BOOST_RANGE_DETAIL_SIZE_HPP -#include -#include -#include -#include +#include // BOOST_MSVC +#include +#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) +# include +#else +# include +# include +# include +# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) +# include +# endif +# include namespace boost { @@ -60,11 +68,19 @@ namespace boost template<> struct range_size_ { + #if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) template< typename T, std::size_t sz > static std::size_t fun( T BOOST_RANGE_ARRAY_REF()[sz] ) { return sz; } + #else + template + static std::size_t fun(T& t) + { + return remove_extent::size; + } + #endif }; template<> @@ -139,5 +155,5 @@ namespace boost } // namespace 'boost' - +# endif #endif diff --git a/include/boost/range/detail/size_type.hpp b/include/boost/range/detail/size_type.hpp index ea2df02..d4f0704 100755 --- a/include/boost/range/detail/size_type.hpp +++ b/include/boost/range/detail/size_type.hpp @@ -30,7 +30,7 @@ namespace boost template< typename C > struct pts { - typedef BOOST_DEDUCED_TYPENAME C::size_type type; + typedef BOOST_RANGE_DEDUCED_TYPENAME C::size_type type; }; }; @@ -108,9 +108,9 @@ namespace boost template< typename C > class range_size { - typedef BOOST_DEDUCED_TYPENAME range_detail::range::type c_type; + typedef typename range_detail::range::type c_type; public: - typedef BOOST_DEDUCED_TYPENAME range_detail::range_size_type_::BOOST_NESTED_TEMPLATE pts::type type; + typedef typename range_detail::range_size_type_::BOOST_NESTED_TEMPLATE pts::type type; }; } diff --git a/include/boost/range/detail/value_type.hpp b/include/boost/range/detail/value_type.hpp index 490bce8..c3a4693 100755 --- a/include/boost/range/detail/value_type.hpp +++ b/include/boost/range/detail/value_type.hpp @@ -12,7 +12,7 @@ #define BOOST_RANGE_DETAIL_VALUE_TYPE_HPP #include -#include +#include #include ////////////////////////////////////////////////////////////////////////////// @@ -32,7 +32,7 @@ namespace boost template< typename C > struct pts { - typedef BOOST_DEDUCED_TYPENAME C::value_type type; + typedef BOOST_RANGE_DEDUCED_TYPENAME C::value_type type; }; }; @@ -42,7 +42,7 @@ namespace boost template< typename P > struct pts { - typedef BOOST_DEDUCED_TYPENAME boost::iterator_value< BOOST_RANGE_DEDUCED_TYPENAME P::first_type >::type type; + typedef BOOST_RANGE_DEDUCED_TYPENAME boost::iterator_value< BOOST_RANGE_DEDUCED_TYPENAME P::first_type >::type type; }; }; @@ -52,7 +52,7 @@ namespace boost template< typename T > struct pts { - typedef BOOST_DEDUCED_TYPENAME boost::remove_bounds::type type; + typedef BOOST_DEDUCED_TYPENAME remove_extent::type type; }; }; diff --git a/include/boost/range/detail/vc6/size.hpp b/include/boost/range/detail/vc6/size.hpp index ae416f6..39f559f 100755 --- a/include/boost/range/detail/vc6/size.hpp +++ b/include/boost/range/detail/vc6/size.hpp @@ -25,15 +25,6 @@ namespace boost template< typename T > struct range_size_; - struct range_size_std_container_ - { - template< typename C > - static BOOST_RANGE_DEDUCED_TYPENAME C::size_type fun( const C& c ) - { - return c.size(); - }; - }; - ////////////////////////////////////////////////////////////////////// // default ////////////////////////////////////////////////////////////////////// @@ -45,7 +36,7 @@ namespace boost struct inner { static BOOST_RANGE_DEDUCED_TYPENAME C::size_type fun( const C& c ) { - return range_size_std_container_::fun(c.size()); + return c.size(); }; }; }; @@ -54,15 +45,6 @@ namespace boost // pair ////////////////////////////////////////////////////////////////////// - struct range_size_std_pair_ { - template< typename P > - static BOOST_RANGE_DEDUCED_TYPENAME range_size

::type - fun( const P& p ) - { - return std::distance( p.first, p.second ); - } - }; - template<> struct range_size_ { @@ -71,7 +53,7 @@ namespace boost static BOOST_RANGE_DEDUCED_TYPENAME range_size

::type fun( const P& p ) { - return range_size_std_pair_::fun( p ); + return std::distance( p.first, p.second ); } }; }; @@ -79,15 +61,6 @@ namespace boost ////////////////////////////////////////////////////////////////////// // array ////////////////////////////////////////////////////////////////////// - - struct range_size_array_ - { - template - static std::size_t fun(T& t) - { - return remove_extent::size; - } - }; template<> struct range_size_ @@ -101,15 +74,6 @@ namespace boost }; }; - struct range_size_char_array_ - { - template - static std::size_t fun(T& t) - { - return sizeof(T) / sizeof(T[0]); - } - }; - template<> struct range_size_ { @@ -117,20 +81,11 @@ namespace boost struct inner { static std::size_t fun(T& t) { - range_size_char_array_::fun(t); + return sizeof(T) / sizeof(T[0]); } }; }; - struct range_size_wchar_t_array_ - { - template - static std::size_t fun(T& t) - { - return sizeof(T) / sizeof(T[0]); - } - }; - template<> struct range_size_ { @@ -138,7 +93,7 @@ namespace boost struct inner { static std::size_t fun(T& t) { - range_size_wchar_t_array_::fun(t); + return sizeof(T) / sizeof(T[0]); } }; };