1 // Copyright David Abrahams 2004. Distributed under the Boost 2 // Software License, Version 1.0. (See accompanying 3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 #ifndef IS_WRAPPER_DWA2004723_HPP 5 # define IS_WRAPPER_DWA2004723_HPP 6 7 # include <boost/python/detail/prefix.hpp> 8 # include <boost/mpl/bool.hpp> 9 10 namespace boost { namespace python { 11 12 template <class T> class wrapper; 13 14 namespace detail 15 { 16 typedef char (&is_not_wrapper)[2]; 17 is_not_wrapper is_wrapper_helper(...); 18 template <class T> 19 char is_wrapper_helper(wrapper<T> const volatile*); 20 21 // A metafunction returning true iff T is [derived from] wrapper<U> 22 template <class T> 23 struct is_wrapper 24 : mpl::bool_<(sizeof(detail::is_wrapper_helper((T*)0)) == 1)> 25 {}; 26 27 }}} // namespace boost::python::detail 28 29 #endif // IS_WRAPPER_DWA2004723_HPP 30