Boost logo

Boost :

Subject: [boost] [python] [concept] CallPolicies implementation
From: Lorenzo Caminiti (lorcaminiti_at_[hidden])
Date: 2011-12-04 05:47:13


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk