
14 May
2008
14 May
'08
12:40 p.m.
AMDG gfsdjkgf@Safe-mail.net wrote:
Hello, let's come straight to the code. I am not sure why it fails (both boost::bind and boost::lambda::bind fail). I use Visual Studio 9 (2008, x86) and boost 1.35 (retail). What's wrong?
#include <boost/bind.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 Test1(Handler_t Handler) { bind(&Test2<Handler_t>, Handler)();
Wrap Handler in boost::protect. For lambda use boost::lambda::protect bind(&Test2<Handler_t>, boost::protect(Handler))();
}
void TestFunc(int i) { }
int main() { Test1(bind(TestFunc,0)); }
In Christ, Steven Watanabe