
AMDG gfsdjkgf@Safe-mail.net wrote:
Wrap Handler in boost::protect. For lambda use boost::lambda::protect
bind(&Test2<Handler_t>, boost::protect(Handler))();
Sorry, but this does not work.
I see. The explicit template parameter needs to be updated too. #include <boost/bind.hpp> #include <boost/bind/protect.hpp> using boost::bind; //#include <boost/lambda/bind.hpp> //using boost::lambda; template<class Handler_t>void Test2(Handler_t Handler) { } template<class Handler_t>void Test1Impl(Handler_t Handler) { bind(&Test2<Handler_t>, Handler)(); } template<class Handler_t>void Test1(Handler_t Handler) { Test1Impl(boost::protect(Handler)); } void TestFunc(int i) { } int main() { Test1(bind(TestFunc,0)); } In Christ, Steven Watanabe