// // Copyright (c) 2015 Zenterio AB // #include #include #include #define DO_CRASH #include class Test { public: Test(boost::function a_Function) : m_Function(a_Function) { // Empty } void F() { m_Function(); } private: boost::function m_Function; }; void Fn(int val) { printf("val=%d\r\n", val); } void DoTest() { printf("1\r\n"); boost::function f = boost::bind(Fn, 100); Test test(f); #ifndef DO_CRASH printf("2\r\n"); // printf of life! #endif test.F(); printf("3\r\n"); } int main(int argc, char** argv) { DoTest(); return 0; }