diff --git a/include/boost/type_traits/detail/composite_member_pointer_type.hpp b/include/boost/type_traits/detail/composite_member_pointer_type.hpp index ecb4b68..a747ee4 100644 --- a/include/boost/type_traits/detail/composite_member_pointer_type.hpp +++ b/include/boost/type_traits/detail/composite_member_pointer_type.hpp @@ -84,6 +84,14 @@ template struct common_member_class >::type type; }; +//This indirection avoids compilation errors on some older +//compilers like MSVC 7.1 +template +struct common_member_class_pointer_to_member +{ + typedef CT CB::* type; +}; + template struct composite_member_pointer_type { private: @@ -95,7 +103,7 @@ private: public: - typedef CT CB::* type; + typedef typename common_member_class_pointer_to_member::type type; }; } // namespace type_traits_detail diff --git a/include/boost/type_traits/detail/composite_pointer_type.hpp b/include/boost/type_traits/detail/composite_pointer_type.hpp index c807954..ae21e18 100644 --- a/include/boost/type_traits/detail/composite_pointer_type.hpp +++ b/include/boost/type_traits/detail/composite_pointer_type.hpp @@ -124,17 +124,26 @@ public: typedef typename boost::copy_cv::type const, T>::type, U>::type type; }; +//Old compilers like MSVC-7.1 have problems using boost::conditional in +//composite_pointer_type. Partially specializing on has_common_pointee::value +//seems to make their life easier +template::value > +struct composite_pointer_type_dispatch + : common_pointee +{}; + +template +struct composite_pointer_type_dispatch + : composite_pointer_impl +{}; + + } // detail + template struct composite_pointer_type { - typedef typename boost::conditional< - - detail::has_common_pointee::value, - detail::common_pointee, - detail::composite_pointer_impl - - >::type::type * type; + typedef typename detail::composite_pointer_type_dispatch::type* type; }; } // namespace type_traits_detail diff --git a/include/boost/type_traits/detail/has_binary_operator.hpp b/include/boost/type_traits/detail/has_binary_operator.hpp index 7bc783a..039a6bb 100644 --- a/include/boost/type_traits/detail/has_binary_operator.hpp +++ b/include/boost/type_traits/detail/has_binary_operator.hpp @@ -37,7 +37,10 @@ # pragma GCC system_header #elif defined(BOOST_MSVC) # pragma warning ( push ) -# pragma warning ( disable : 4018 4244 4547 4800 4804 4805 4913 6334) +# pragma warning ( disable : 4018 4244 4547 4800 4804 4805 4913) +# if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) +# pragma warning ( disable : 6334) +# endif #endif namespace boost { diff --git a/include/boost/type_traits/detail/has_postfix_operator.hpp b/include/boost/type_traits/detail/has_postfix_operator.hpp index 2a6c706..3e686f1 100644 --- a/include/boost/type_traits/detail/has_postfix_operator.hpp +++ b/include/boost/type_traits/detail/has_postfix_operator.hpp @@ -23,7 +23,10 @@ # pragma GCC system_header #elif defined(BOOST_MSVC) # pragma warning ( push ) -# pragma warning ( disable : 4244 4913 6334) +# pragma warning ( disable : 4244 4913) +# if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) +# pragma warning ( disable : 6334) +# endif #endif namespace boost { diff --git a/include/boost/type_traits/detail/has_prefix_operator.hpp b/include/boost/type_traits/detail/has_prefix_operator.hpp index 72279e7..d4574fc 100644 --- a/include/boost/type_traits/detail/has_prefix_operator.hpp +++ b/include/boost/type_traits/detail/has_prefix_operator.hpp @@ -31,9 +31,14 @@ # pragma GCC system_header #elif defined(BOOST_MSVC) # pragma warning ( push ) -# pragma warning ( disable : 4146 4804 4913 4244 6334) +# pragma warning ( disable : 4146 4804 4913 4244) +# if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) +# pragma warning ( disable : 6334) +# endif #endif + + namespace boost { namespace detail { diff --git a/include/boost/type_traits/is_convertible.hpp b/include/boost/type_traits/is_convertible.hpp index bc11a59..417ece2 100644 --- a/include/boost/type_traits/is_convertible.hpp +++ b/include/boost/type_traits/is_convertible.hpp @@ -300,13 +300,26 @@ struct is_convertible_basic_impl: // This version seems to work pretty well for a wide spectrum of compilers, // however it does rely on undefined behaviour by passing UDT's through (...). // + +//Workaround for old compilers like MSVC 7.1 to avoid +//forming a reference to an array of unknown bound +template +struct is_convertible_basic_impl_add_lvalue_reference + : add_lvalue_reference +{}; + +template +struct is_convertible_basic_impl_add_lvalue_reference +{ + typedef From type []; +}; + template struct is_convertible_basic_impl { static ::boost::type_traits::no_type BOOST_TT_DECL _m_check(...); static ::boost::type_traits::yes_type BOOST_TT_DECL _m_check(To); - typedef typename add_lvalue_reference::type lvalue_type; - typedef typename add_rvalue_reference::type rvalue_type; + typedef typename is_convertible_basic_impl_add_lvalue_reference::type lvalue_type; static lvalue_type _m_from; #ifdef BOOST_MSVC #pragma warning(push) @@ -316,6 +329,7 @@ struct is_convertible_basic_impl #endif #endif #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + typedef typename add_rvalue_reference::type rvalue_type; BOOST_STATIC_CONSTANT(bool, value = sizeof( _m_check(static_cast(_m_from)) ) == sizeof(::boost::type_traits::yes_type) ); diff --git a/include/boost/type_traits/is_floating_point.hpp b/include/boost/type_traits/is_floating_point.hpp old mode 100755 new mode 100644 diff --git a/include/boost/type_traits/is_member_object_pointer.hpp b/include/boost/type_traits/is_member_object_pointer.hpp old mode 100755 new mode 100644 diff --git a/include/boost/type_traits/is_signed.hpp b/include/boost/type_traits/is_signed.hpp index 48facd3..70ca2e4 100644 --- a/include/boost/type_traits/is_signed.hpp +++ b/include/boost/type_traits/is_signed.hpp @@ -19,7 +19,9 @@ namespace boost { #if !defined( __CODEGEARC__ ) -#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) && !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) +#if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1310) && \ + !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) &&\ + !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) namespace detail{ diff --git a/include/boost/type_traits/is_unsigned.hpp b/include/boost/type_traits/is_unsigned.hpp index 309f3ed..c4c54af 100644 --- a/include/boost/type_traits/is_unsigned.hpp +++ b/include/boost/type_traits/is_unsigned.hpp @@ -20,7 +20,9 @@ namespace boost { #if !defined( __CODEGEARC__ ) -#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) && !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) +#if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1310) &&\ + !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) &&\ + !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) namespace detail{ diff --git a/test/is_member_obj_test.cpp b/test/is_member_obj_test.cpp old mode 100755 new mode 100644