I am using boost::protect
many times in my templates to binding functions. Is it in the new standard? I haven't found it. As I see std::forward
do something similar.
Many thanks for help!
Example: path through a functor to a bind:
class C
{
public:
void method1(int i);
};
class B
{
public:
void method2(const boost::function<void(int)>&);
};
...
B* b_ptr;
C* c_ptr;
...
// when func() is called C::method1 of c_ptr is pass through to B::method2 of b_ptr
boost::function<void(void)> func(boost::bind(&B::method2,b_ptr,boost::protect(boost::bind(&C::method1,c_ptr,_1))));