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 RETURN_INTERNAL_REFERENCE_DWA2002131_HPP
0006 # define RETURN_INTERNAL_REFERENCE_DWA2002131_HPP
0007 
0008 # include <boost/python/detail/prefix.hpp>
0009 
0010 # include <boost/python/default_call_policies.hpp>
0011 # include <boost/python/reference_existing_object.hpp>
0012 # include <boost/python/with_custodian_and_ward.hpp>
0013 # include <boost/mpl/if.hpp>
0014 
0015 namespace boost { namespace python { 
0016 
0017 namespace detail
0018 {
0019   template <std::size_t>
0020   struct return_internal_reference_owner_arg_must_be_greater_than_zero
0021 # if defined(__GNUC__) || defined(__EDG__)
0022   {}
0023 # endif
0024   ;
0025 }
0026 
0027 template <std::size_t owner_arg = 1, class BasePolicy_ = default_call_policies>
0028 struct return_internal_reference
0029     : with_custodian_and_ward_postcall<0, owner_arg, BasePolicy_>
0030 {
0031  private:
0032     BOOST_STATIC_CONSTANT(bool, legal = owner_arg > 0);
0033  public:
0034     typedef typename mpl::if_c<
0035         legal
0036         , reference_existing_object
0037         , detail::return_internal_reference_owner_arg_must_be_greater_than_zero<owner_arg>
0038     >::type result_converter;
0039 };
0040 
0041 }} // namespace boost::python
0042 
0043 #endif // RETURN_INTERNAL_REFERENCE_DWA2002131_HPP