#include #include "boost/function.hpp" struct LogBuffer : public std::streambuf { char m_buf[222]; }; struct Fun { void operator()() { if (i != 5) { abort(); } } int i; }; void x() { boost::function f; f = Fun{5}; LogBuffer c; f(); } int main(int argc, char *argv[]) { x(); }