boostorg / python

Boost.org python module
http://boostorg.github.io/python
Boost Software License 1.0
469 stars 201 forks source link

support lambda/function object callbacks #34

Open nevion opened 9 years ago

nevion commented 9 years ago

See http://stackoverflow.com/questions/16845547/using-c11-lambda-as-accessor-function-in-boostpythons-add-property-get-sig for possible ideas and discussion

We need a painless - wrapper free way to specify regular old lambdas which support captures - the plain function's yielded with + almost satisfies this but does not support captues

This causes code to be far longer than necessary and from first hand experience, lambdas are much more macro friendly.

nevion commented 9 years ago

This library: http://www.boost.org/doc/libs/1_59_0/libs/function_types/doc/html/boost_functiontypes/reference/decomposition.html should shorten up get_signatures function significantly.

Here is a demonstration of use with lambdas http://stackoverflow.com/questions/4482646/is-there-a-way-to-deduce-the-signature-of-a-lambda-as-an-mpl-sequence