is_wrapper.hpp 839 B

1234567891011121314151617181920212223242526272829
  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. # include <boost/python/detail/prefix.hpp>
  7. # include <boost/mpl/bool.hpp>
  8. namespace boost { namespace python {
  9. template <class T> class wrapper;
  10. namespace detail
  11. {
  12. typedef char (&is_not_wrapper)[2];
  13. is_not_wrapper is_wrapper_helper(...);
  14. template <class T>
  15. char is_wrapper_helper(wrapper<T> const volatile*);
  16. // A metafunction returning true iff T is [derived from] wrapper<U>
  17. template <class T>
  18. struct is_wrapper
  19. : mpl::bool_<(sizeof(detail::is_wrapper_helper((T*)0)) == 1)>
  20. {};
  21. }}} // namespace boost::python::detail
  22. #endif // IS_WRAPPER_DWA2004723_HPP