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 REFERENCE_EXISTING_OBJECT_DWA200222_HPP
6 # define REFERENCE_EXISTING_OBJECT_DWA200222_HPP
8 # include <boost/python/detail/prefix.hpp>
9 # include <boost/python/detail/indirect_traits.hpp>
10 # include <boost/mpl/if.hpp>
11 # include <boost/python/to_python_indirect.hpp>
12 # include <boost/python/detail/type_traits.hpp>
14 namespace boost { namespace python {
19 struct reference_existing_object_requires_a_pointer_or_reference_return_type
20 # if defined(__GNUC__) || defined(__EDG__)
26 template <class T> struct to_python_value;
28 struct reference_existing_object
33 BOOST_STATIC_CONSTANT(
34 bool, ok = detail::is_pointer<T>::value || detail::is_reference<T>::value);
36 typedef typename mpl::if_c<
38 , to_python_indirect<T, detail::make_reference_holder>
39 , detail::reference_existing_object_requires_a_pointer_or_reference_return_type<T>
44 }} // namespace boost::python
46 #endif // REFERENCE_EXISTING_OBJECT_DWA200222_HPP