[C++-sig] [boost.python] Interoperability with boost.bind

David Abrahams dave at boost-consulting.com
Sat Jul 2 02:07:51 CEST 2005

Markus Schöpflin <markus.schoepflin at comsoft.de> writes:

> Is boost.python compatible with boost.bind (see example below)? 

Not in that way, no.  The requirements of def() are clearly spelled
out in http://www.boost.org/libs/python/doc/v2/def.html#def-spec, and
bind_t<> specializations do not meet them ... mostly because I don't
have a way to deduce the signature of a bind expression.

However, you can do:

      , make_function(
          , default_call_policies()
          , boost::mpl::vector<int,int>()

See http://www.boost.org/libs/python/doc/v2/make_function.html

Dave Abrahams
Boost Consulting

More information about the Cplusplus-sig mailing list