|
Boost : |
Subject: Re: [boost] [python] [concept] CallPolicies implementation
From: Dave Abrahams (dave_at_[hidden])
Date: 2011-12-15 07:20:40
on Sun Dec 04 2011, Lorenzo Caminiti <lorcaminiti-AT-gmail.com> wrote:
> 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
AFAIK there are no concept-checking classes for Boost.Python.
> 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 suppose so.
-- Dave Abrahams BoostPro Computing http://www.boostpro.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk