
4 Dec
2011
4 Dec
'11
10:47 a.m.
Hello all, Does Boost.Python implement the CallPolicies concept? I couldn't find it... http://www.boost.org/doc/libs/1_48_0/libs/python/doc/v2/CallPolicies.html If not, would something like this be OK?? template<class P> struct CallPolicies { BOOST_CONCEPT_ASSERT((ResultConverterGenerator<P::result_converter>)); BOOST_CONCEPT_ASSERT((Metafunction<P::extract_return_type>)) BOOST_CONCEPT_USAGE(CallPolicies) { bool b = x.precall(a); // convertible to bool PyObject* o = x.postcall(a, r); // convertible to PyObject* } private: P x; PyObject* a; PyObject* r; }; I'd have to implement ResultConverterGenerator and Metafunction as well. Thanks. --Lorenzo