2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 06:02:14 +00:00

*** empty log message ***

[SVN r12627]
This commit is contained in:
Dave Abrahams
2002-02-02 08:31:11 +00:00
parent 684e391a9a
commit 12988b879e
4 changed files with 12 additions and 14 deletions

View File

@@ -21,7 +21,7 @@ namespace detail
;
}
template <class T> struct to_python;
template <class T> struct to_python_value;
struct copy_const_reference
{
@@ -30,7 +30,7 @@ struct copy_const_reference
{
typedef typename mpl::select_type<
detail::is_reference_to_const<T>::value
, to_python<T>
, to_python_value<T>
, detail::copy_const_reference_expects_a_const_reference_return_type<T>
>::type type;
};

View File

@@ -21,7 +21,7 @@ namespace detail
;
}
template <class T> struct to_python;
template <class T> struct to_python_value;
struct copy_non_const_reference
{
@@ -30,7 +30,7 @@ struct copy_non_const_reference
{
typedef typename mpl::select_type<
boost::python::detail::is_reference_to_non_const<T>::value
, to_python<T>
, to_python_value<T>
, detail::copy_non_const_reference_expects_a_non_const_reference_return_type<T>
>::type type;
};

View File

@@ -7,10 +7,12 @@
# define DEFAULT_CALL_POLICIES_DWA2002131_HPP
# include <boost/python/detail/wrap_python.hpp>
# include <boost/mpl/select_type.hpp>
# include <boost/python/to_python_value.hpp>
# include <boost/type_traits/transform_traits.hpp>
namespace boost { namespace python {
template <class T> struct to_python;
template <class T> struct to_python_value;
namespace detail
{
@@ -49,7 +51,9 @@ struct default_result_converter
typedef typename mpl::select_type<
is_reference<R>::value | is_pointer<R>::value
, detail::specify_a_result_policy_to_wrap_functions_returning<R>
, to_python<R>
, boost::python::to_python_value<
typename add_reference<typename add_const<R>::type>::type
>
>::type type;
};
};
@@ -58,13 +62,13 @@ struct default_result_converter
template <>
struct default_result_converter::apply<char const*>
{
typedef boost::python::to_python<char const*> type;
typedef boost::python::to_python_value<char const*const&> type;
};
template <>
struct default_result_converter::apply<PyObject*>
{
typedef boost::python::to_python<PyObject*> type;
typedef boost::python::to_python_value<PyObject*const&> type;
};
}} // namespace boost::python

View File

@@ -11,7 +11,6 @@
# include <boost/python/converter/registration.hpp>
# include <boost/python/detail/caller.hpp>
# include <boost/python/detail/arg_tuple_size.hpp>
# include <boost/python/detail/signature.hpp>
# include <boost/mpl/size.hpp>
# include <boost/function.hpp>
# include <boost/bind.hpp>
@@ -22,7 +21,6 @@ namespace boost { namespace python {
template <class F>
objects::function* make_function(F f)
{
converter::acquire_registrations(detail::signature(f));
return new objects::function(
objects::py_function(
::boost::bind<PyObject*>(detail::caller(), f, _1, _2, default_call_policies()))
@@ -32,7 +30,6 @@ objects::function* make_function(F f)
template <class F, class Policies>
objects::function* make_function(F f, Policies const& policies)
{
converter::acquire_registrations(detail::signature(f));
return new objects::function(
objects::py_function(
::boost::bind<PyObject*>(detail::caller(), f, _1, _2, policies))
@@ -44,9 +41,6 @@ objects::function* make_constructor(T* = 0, ArgList* = 0, Generator* = 0)
{
enum { nargs = mpl::size<ArgList>::value };
typedef typename mpl::push_front<ArgList,void>::sequence signature;
converter::acquire_registrations(signature());
return new objects::function(
objects::py_function(
::boost::bind<PyObject*>(detail::caller(),