]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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 | ||
8 | # include <boost/python/detail/prefix.hpp> | |
b32b8144 | 9 | # include <boost/python/detail/type_traits.hpp> |
7c673cae FG |
10 | |
11 | namespace boost { namespace python { | |
12 | ||
13 | namespace detail | |
14 | { | |
15 | template <bool is_ptr = true> | |
16 | struct pointee_impl | |
17 | { | |
b32b8144 | 18 | template <class T> struct apply : detail::remove_pointer<T> {}; |
7c673cae FG |
19 | }; |
20 | ||
21 | template <> | |
22 | struct pointee_impl<false> | |
23 | { | |
24 | template <class T> struct apply | |
25 | { | |
26 | typedef typename T::element_type type; | |
27 | }; | |
28 | }; | |
29 | } | |
30 | ||
31 | template <class T> | |
32 | struct pointee | |
33 | : detail::pointee_impl< | |
b32b8144 | 34 | detail::is_pointer<T>::value |
7c673cae FG |
35 | >::template apply<T> |
36 | { | |
37 | }; | |
38 | ||
b32b8144 | 39 | }} // namespace boost::python |
7c673cae FG |
40 | |
41 | #endif // POINTEE_DWA2002323_HPP |