cv_category.hpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright David Abrahams 2002.
  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 CV_CATEGORY_DWA200222_HPP
  6. # define CV_CATEGORY_DWA200222_HPP
  7. # include <boost/python/detail/type_traits.hpp>
  8. namespace boost { namespace python { namespace detail {
  9. template <bool is_const_, bool is_volatile_>
  10. struct cv_tag
  11. {
  12. BOOST_STATIC_CONSTANT(bool, is_const = is_const_);
  13. BOOST_STATIC_CONSTANT(bool, is_volatile = is_volatile_);
  14. };
  15. typedef cv_tag<false,false> cv_unqualified;
  16. typedef cv_tag<true,false> const_;
  17. typedef cv_tag<false,true> volatile_;
  18. typedef cv_tag<true,true> const_volatile_;
  19. template <class T>
  20. struct cv_category
  21. {
  22. // BOOST_STATIC_CONSTANT(bool, c = is_const<T>::value);
  23. // BOOST_STATIC_CONSTANT(bool, v = is_volatile<T>::value);
  24. typedef cv_tag<
  25. is_const<T>::value
  26. , is_volatile<T>::value
  27. > type;
  28. };
  29. }}} // namespace boost::python::detail
  30. #endif // CV_CATEGORY_DWA200222_HPP