author | sl |
Tue, 10 Jun 2014 14:32:02 +0200 | |
changeset 1 | 260cb5ec6c19 |
permissions | -rw-r--r-- |
sl@0 | 1 |
// Copyright David Abrahams 2002. |
sl@0 | 2 |
// Distributed under the Boost Software License, Version 1.0. (See |
sl@0 | 3 |
// accompanying file LICENSE_1_0.txt or copy at |
sl@0 | 4 |
// http://www.boost.org/LICENSE_1_0.txt) |
sl@0 | 5 |
#ifndef POINTEE_DWA2002323_HPP |
sl@0 | 6 |
# define POINTEE_DWA2002323_HPP |
sl@0 | 7 |
|
sl@0 | 8 |
# include <boost/python/detail/prefix.hpp> |
sl@0 | 9 |
|
sl@0 | 10 |
# include <boost/type_traits/object_traits.hpp> |
sl@0 | 11 |
# include <boost/type_traits/remove_pointer.hpp> |
sl@0 | 12 |
|
sl@0 | 13 |
namespace boost { namespace python { |
sl@0 | 14 |
|
sl@0 | 15 |
namespace detail |
sl@0 | 16 |
{ |
sl@0 | 17 |
template <bool is_ptr = true> |
sl@0 | 18 |
struct pointee_impl |
sl@0 | 19 |
{ |
sl@0 | 20 |
template <class T> struct apply : remove_pointer<T> {}; |
sl@0 | 21 |
}; |
sl@0 | 22 |
|
sl@0 | 23 |
template <> |
sl@0 | 24 |
struct pointee_impl<false> |
sl@0 | 25 |
{ |
sl@0 | 26 |
template <class T> struct apply |
sl@0 | 27 |
{ |
sl@0 | 28 |
typedef typename T::element_type type; |
sl@0 | 29 |
}; |
sl@0 | 30 |
}; |
sl@0 | 31 |
} |
sl@0 | 32 |
|
sl@0 | 33 |
template <class T> |
sl@0 | 34 |
struct pointee |
sl@0 | 35 |
: detail::pointee_impl< |
sl@0 | 36 |
::boost::is_pointer<T>::value |
sl@0 | 37 |
>::template apply<T> |
sl@0 | 38 |
{ |
sl@0 | 39 |
}; |
sl@0 | 40 |
|
sl@0 | 41 |
}} // namespace boost::python::detail |
sl@0 | 42 |
|
sl@0 | 43 |
#endif // POINTEE_DWA2002323_HPP |