Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/python/manage_new_object.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 MANAGE_NEW_OBJECT_DWA200222_HPP
0006 # define MANAGE_NEW_OBJECT_DWA200222_HPP
0007 
0008 # include <boost/python/detail/prefix.hpp>
0009 # include <boost/python/detail/indirect_traits.hpp>
0010 # include <boost/python/detail/type_traits.hpp>
0011 # include <boost/mpl/if.hpp>
0012 # include <boost/python/to_python_indirect.hpp>
0013 
0014 namespace boost { namespace python { 
0015 
0016 namespace detail
0017 {
0018   template <class R>
0019   struct manage_new_object_requires_a_pointer_return_type
0020 # if defined(__GNUC__) || defined(__EDG__)
0021   {}
0022 # endif
0023   ;
0024 }
0025 
0026 struct manage_new_object
0027 {
0028     template <class T>
0029     struct apply
0030     {
0031         typedef typename mpl::if_c<
0032             detail::is_pointer<T>::value
0033             , to_python_indirect<T, detail::make_owning_holder>
0034             , detail::manage_new_object_requires_a_pointer_return_type<T>
0035         >::type type;
0036     };
0037 };
0038 
0039 }} // namespace boost::python
0040 
0041 #endif // MANAGE_NEW_OBJECT_DWA200222_HPP