Chris@16: // (C) Copyright Thorsten Ottosen 2005 Chris@16: // (C) Copyright Howard Hinnant 2004 Chris@16: // (C) Copyright Jonathan Turkanis 2004 Chris@16: // Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.) Chris@16: Chris@16: // Chris@16: // Contains type traits machinery for incomplete arrays. MPL compatibility Chris@16: // is included for completeness, but is not necessary for the current Chris@16: // application. Chris@16: // Chris@16: Chris@16: #ifndef BOOST_MOVE_PTR_ARRAYS_HPP_INCLUDED Chris@16: #define BOOST_MOVE_PTR_ARRAYS_HPP_INCLUDED Chris@16: Chris@16: #include // BOOST_STATIC_CONSTANT. Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { namespace ptr_container_detail { namespace move_ptrs { Chris@16: Chris@16: // From Howard Hinnant. Chris@16: template Chris@16: struct is_array_convertible { Chris@16: typedef typename remove_bounds::type t_element; Chris@16: typedef typename remove_bounds::type u_element; Chris@16: typedef typename remove_cv::type t_base; Chris@16: typedef typename remove_cv::type u_base; Chris@16: typedef typename Chris@16: mpl::and_< Chris@16: is_array, Chris@16: is_array, Chris@16: is_same, Chris@16: is_convertible Chris@16: >::type type; Chris@16: BOOST_STATIC_CONSTANT(bool, value = type::value); Chris@16: BOOST_MPL_AUX_LAMBDA_SUPPORT(2, is_array_convertible, (T, U)) Chris@16: }; Chris@16: Chris@16: template Chris@16: struct is_smart_ptr_convertible Chris@16: : mpl::if_< Chris@16: is_array, Chris@16: is_array_convertible, Chris@16: is_convertible Chris@16: >::type Chris@16: { }; Chris@16: Chris@16: #ifndef BOOST_NO_SFINAE Chris@16: template Chris@16: struct enable_if_convertible Chris@16: : enable_if< Chris@16: is_smart_ptr_convertible, Chris@16: T Chris@16: > Chris@16: { }; Chris@16: #else Chris@16: template Chris@16: struct enable_if_convertible : mpl::identity { }; Chris@16: #endif Chris@16: Chris@16: } } } // End namespaces ptr_container_detail, move_ptrs, boost. Chris@16: Chris@16: #endif // #ifndef BOOST_MOVE_PTR_ARRAYS_HPP_INCLUDED