other.hpp 901 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef BOOST_PYTHON_OTHER_HPP
  2. # define BOOST_PYTHON_OTHER_HPP
  3. # include <boost/python/detail/prefix.hpp>
  4. // Copyright David Abrahams 2002.
  5. // Distributed under the Boost Software License, Version 1.0. (See
  6. // accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. # include <boost/config.hpp>
  9. namespace boost { namespace python {
  10. template<class T> struct other
  11. {
  12. typedef T type;
  13. };
  14. namespace detail
  15. {
  16. template<typename T>
  17. class is_other
  18. {
  19. public:
  20. BOOST_STATIC_CONSTANT(bool, value = false);
  21. };
  22. template<typename T>
  23. class is_other<other<T> >
  24. {
  25. public:
  26. BOOST_STATIC_CONSTANT(bool, value = true);
  27. };
  28. template<typename T>
  29. class unwrap_other
  30. {
  31. public:
  32. typedef T type;
  33. };
  34. template<typename T>
  35. class unwrap_other<other<T> >
  36. {
  37. public:
  38. typedef T type;
  39. };
  40. }
  41. }} // namespace boost::python
  42. #endif