From 1a5f11bb5a9c544be9e978ee8a76249697ff0ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Sat, 19 Sep 2015 23:09:46 +0200 Subject: [PATCH] Second patch that makes all common type tests happy. --- .../detail/composite_pointer_type.hpp | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/include/boost/type_traits/detail/composite_pointer_type.hpp b/include/boost/type_traits/detail/composite_pointer_type.hpp index f3edb5e..ae21e18 100644 --- a/include/boost/type_traits/detail/composite_pointer_type.hpp +++ b/include/boost/type_traits/detail/composite_pointer_type.hpp @@ -124,19 +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 { - //Done in two steps to avoid compilation errors - //in old compilers like MSVC 7.1 - typedef typename boost::conditional< - - detail::has_common_pointee::value, - detail::common_pointee, - detail::composite_pointer_impl - >::type first_type; - typename first_type::type * type; + typedef typename detail::composite_pointer_type_dispatch::type* type; }; } // namespace type_traits_detail