// (C) Copyright Thorsten Ottosen 2005 // (C) Copyright Howard Hinnant 2004 // (C) Copyright Jonathan Turkanis 2004 // 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.) // // Contains type traits machinery for incomplete arrays. MPL compatibility // is included for completeness, but is not necessary for the current // application. // #ifndef BOOST_MOVE_PTR_ARRAYS_HPP_INCLUDED #define BOOST_MOVE_PTR_ARRAYS_HPP_INCLUDED #include // BOOST_STATIC_CONSTANT. #include #include #include #include #include #include #include #include #include #include #include namespace boost { namespace ptr_container_detail { namespace move_ptrs { // From Howard Hinnant. template struct is_array_convertible { typedef typename remove_bounds::type t_element; typedef typename remove_bounds::type u_element; typedef typename remove_cv::type t_base; typedef typename remove_cv::type u_base; typedef typename mpl::and_< is_array, is_array, is_same, is_convertible >::type type; BOOST_STATIC_CONSTANT(bool, value = type::value); BOOST_MPL_AUX_LAMBDA_SUPPORT(2, is_array_convertible, (T, U)) }; template struct is_smart_ptr_convertible : mpl::if_< is_array, is_array_convertible, is_convertible >::type { }; #ifndef BOOST_NO_SFINAE template struct enable_if_convertible : enable_if< is_smart_ptr_convertible, T > { }; #else template struct enable_if_convertible : mpl::identity { }; #endif } } } // End namespaces ptr_container_detail, move_ptrs, boost. #endif // #ifndef BOOST_MOVE_PTR_ARRAYS_HPP_INCLUDED