Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:46:10

0001 // Copyright David Abrahams 2002.
0002 // Distributed under the Boost Software License, Version 1.0. (See
0003 // accompanying file LICENSE_1_0.txt or copy at
0004 // http://www.boost.org/LICENSE_1_0.txt)
0005 #ifndef REFERENCE_EXISTING_OBJECT_DWA200222_HPP
0006 # define REFERENCE_EXISTING_OBJECT_DWA200222_HPP
0007 
0008 # include <boost/python/detail/prefix.hpp>
0009 # include <boost/python/detail/indirect_traits.hpp>
0010 # include <boost/mpl/if.hpp>
0011 # include <boost/python/to_python_indirect.hpp>
0012 # include <boost/python/detail/type_traits.hpp>
0013 
0014 namespace boost { namespace python { 
0015 
0016 namespace detail
0017 {
0018   template <class R>
0019   struct reference_existing_object_requires_a_pointer_or_reference_return_type
0020 # if defined(__GNUC__) || defined(__EDG__)
0021   {}
0022 # endif
0023   ;
0024 }
0025 
0026 template <class T> struct to_python_value;
0027 
0028 struct reference_existing_object
0029 {
0030     template <class T>
0031     struct apply
0032     {
0033         BOOST_STATIC_CONSTANT(
0034             bool, ok = detail::is_pointer<T>::value || detail::is_reference<T>::value);
0035         
0036         typedef typename mpl::if_c<
0037             ok
0038             , to_python_indirect<T, detail::make_reference_holder>
0039             , detail::reference_existing_object_requires_a_pointer_or_reference_return_type<T>
0040         >::type type;
0041     };
0042 };
0043 
0044 }} // namespace boost::python
0045 
0046 #endif // REFERENCE_EXISTING_OBJECT_DWA200222_HPP