1 [section boost/python/default_call_policies.hpp]
2 [section Class `default_call_policies`]
3 `default_call_policies` is a model of [link concepts.callpolicies `CallPolicies`] with no `precall` or `postcall` behavior and a `result_converter` which handles by-value returns. Wrapped C++ functions and member functions `use default_call_policies` unless otherwise specified. You may find it convenient to derive new models of [link concepts.callpolicies `CallPolicies`] from `default_call_policies`.
5 namespace boost { namespace python
7 struct default_call_policies
9 static bool precall(PyObject*);
10 static PyObject* postcall(PyObject*, PyObject* result);
11 typedef default_result_converter result_converter;
12 template <class Sig> struct extract_return_type : mpl::front<Sig>{};
17 [section Class `default_call_policies` static functions]
18 ``bool precall(PyObject*);``
23 ``PyObject* postcall(PyObject*, PyObject* result);``
29 [section Class `default_result_converter`]
30 default_result_converter is a model of [link concepts.resultconverter.resultconvertergenerator_concept `ResultConverterGenerator`] which can be used to wrap C++ functions returning non-pointer types, `char const*`, and `PyObject*`, by-value.
32 namespace boost { namespace python
34 struct default_result_converter
36 template <class T> struct apply;
41 [section Class `default_result_converter` metafunctions]
42 ``template <class T> struct apply``
44 [[Requires][T is not a reference type. If T is a pointer type, T is const char* or PyObject*. ]]
45 [[Returns][typedef to_python_value<T const&> type;]]
49 This example comes from the Boost.Python implementation itself. Because the return_value_policy class template does not implement precall or postcall behavior, its default base class is default_call_policies:
51 template <class Handler, class Base = default_call_policies>
52 struct return_value_policy : Base
54 typedef Handler result_converter;