I like using
boost::function for callbacks, and
boost::bind for
partial application to allow those callbacks to do fancy things. And when I say I like it, I mean I love it so much I would change my name to
std::function Wakely if it wasn't for the little problem of people mis-hearing it as StudFunction Wakely, which would just be silly. Anyway, when I wanted to use them for some cross-language callbacks in Python I was very pleased to find a section on
boost.function objects in the Python wiki page about Boost.Python, where the file py_boost_function.hpp written by Alcides Viamontes Esquivel is attached. That little bit of
magic sufficiently advanced technology lets me define callbacks which might call a partially-applied C++ function or a python function, or mixtures of both. Those callbacks can do pretty much
anything. Power extreme. Thanks, Alcides. Thalcides.