我正在尝试boost::bind
使用boost::function
这个。这似乎是一个微不足道的例子,但我无法让它发挥作用。你能帮助我吗?
是因为不允许这样做还是我做错了什么?
// .h
class MyClass{
publc:
void DoSomething(
const std::string& a,
const std::string& b);
void DoABind();
}
//.cpp
void MyClass::DoABind(){
boost::function< void( const std::string& , const std::string& ) > callback(
boost::bind(
&MyClass::DoSomething,
this ));
// this line doesn't compile!!!
}