source: NonGTP/Boost/boost/python/converter/registered_pointee.hpp @ 857

Revision 857, 1.5 KB checked in by igarcia, 19 years ago (diff)
Line 
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 REGISTERED_POINTEE_DWA2002710_HPP
6# define REGISTERED_POINTEE_DWA2002710_HPP
7# include <boost/python/converter/registered.hpp>
8# include <boost/python/converter/pointer_type_id.hpp>
9# include <boost/python/converter/registry.hpp>
10# include <boost/type_traits/transform_traits.hpp>
11# include <boost/type_traits/cv_traits.hpp>
12
13namespace boost { namespace python { namespace converter {
14
15struct registration;
16
17# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
18template <class T>
19struct registered_pointee
20    : registered<
21        typename remove_pointer<
22           typename remove_cv<
23              typename remove_reference<T>::type
24           >::type
25        >::type
26    >
27{
28};
29# else
30namespace detail
31{
32  template <class T>
33  struct registered_pointee_base
34  {
35      static registration const& converters;
36  };
37}
38
39template <class T>
40struct registered_pointee
41    : detail::registered_pointee_base<
42        typename add_reference<
43           typename add_cv<T>::type
44        >::type
45    >
46{
47};
48
49//
50// implementations
51//
52namespace detail
53{
54  template <class T>
55  registration const& registered_pointee_base<T>::converters
56     = registry::lookup(pointer_type_id<T>());
57}
58
59# endif
60}}} // namespace boost::python::converter
61
62#endif // REGISTERED_POINTEE_DWA2002710_HPP
Note: See TracBrowser for help on using the repository browser.