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