#ifndef BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_MEMBER_POINTER_TYPE_HPP_INCLUDED #define BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_MEMBER_POINTER_TYPE_HPP_INCLUDED // // Copyright 2015 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // #include #include #include #include #include #include namespace boost { namespace type_traits_detail { template struct composite_member_pointer_type; // nullptr_t #if !defined( BOOST_NO_CXX11_NULLPTR ) #if !defined( BOOST_NO_CXX11_DECLTYPE ) && ( ( defined( __clang__ ) && !defined( _LIBCPP_VERSION ) ) || defined( __INTEL_COMPILER ) ) template struct composite_member_pointer_type { typedef T C::* type; }; template struct composite_member_pointer_type { typedef T C::* type; }; template<> struct composite_member_pointer_type { typedef decltype(nullptr) type; }; #else template struct composite_member_pointer_type { typedef T C::* type; }; template struct composite_member_pointer_type { typedef T C::* type; }; template<> struct composite_member_pointer_type { typedef std::nullptr_t type; }; #endif #endif // !defined( BOOST_NO_CXX11_NULLPTR ) template struct common_member_class; template struct common_member_class { typedef C type; }; template struct common_member_class { typedef typename boost::conditional< boost::is_base_of::value, C2, typename boost::conditional::value, C1, void>::type >::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: typedef typename composite_pointer_type::type CPT; typedef typename boost::remove_pointer::type CT; typedef typename common_member_class::type CB; public: typedef typename common_member_class_pointer_to_member::type type; }; } // namespace type_traits_detail } // namespace boost #endif // #ifndef BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_MEMBER_POINTER_TYPE_HPP_INCLUDED