pointee.hpp 791 B

1234567891011121314151617181920212223242526272829303132333435
  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 POINTEE_DWA2002323_HPP
  6. # define POINTEE_DWA2002323_HPP
  7. # include <boost/python/detail/type_traits.hpp>
  8. namespace boost { namespace python { namespace detail {
  9. template <bool is_ptr = true>
  10. struct pointee_impl
  11. {
  12. template <class T> struct apply : remove_pointer<T> {};
  13. };
  14. template <>
  15. struct pointee_impl<false>
  16. {
  17. template <class T> struct apply
  18. {
  19. typedef typename T::element_type type;
  20. };
  21. };
  22. template <class T>
  23. struct pointee
  24. : pointee_impl<is_pointer<T>::value>::template apply<T>
  25. {
  26. };
  27. }}} // namespace boost::python::detail
  28. #endif // POINTEE_DWA2002323_HPP