value_is_xxx.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. // Copyright David Abrahams 2003.
  2. // Distributed under the Boost Software License, Version 1.0. (See
  3. // accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef VALUE_IS_XXX_DWA2003224_HPP
  6. # define VALUE_IS_XXX_DWA2003224_HPP
  7. # include <boost/config.hpp>
  8. # include <boost/mpl/bool.hpp>
  9. # include <boost/preprocessor/enum_params.hpp>
  10. # include <boost/python/detail/type_traits.hpp>
  11. # include <boost/python/detail/is_xxx.hpp>
  12. namespace boost { namespace python { namespace detail {
  13. # define BOOST_PYTHON_VALUE_IS_XXX_DEF(name, qualified_name, nargs) \
  14. template <class X_> \
  15. struct value_is_##name \
  16. { \
  17. BOOST_PYTHON_IS_XXX_DEF(name,qualified_name,nargs) \
  18. BOOST_STATIC_CONSTANT(bool, value = is_##name< \
  19. typename remove_cv< \
  20. typename remove_reference<X_>::type \
  21. >::type \
  22. >::value); \
  23. typedef mpl::bool_<value> type; \
  24. \
  25. };
  26. }}} // namespace boost::python::detail
  27. #endif // VALUE_IS_XXX_DWA2003224_HPP