我有一个功能void get(boost::function<void(void)> callback) { callback(); }
。我想在get(boost::bind(/* don't know what to put here*/));
不实现任何其他函数、变量或结构的情况下进行调用,以便回调什么都不做。是否可以在C++03中实现这样的“无操作”回调?
使用 ofboost::bind()
是首选但不是必需的 - 可能是,还有一些其他技巧可以实现我的目标。
我有一个功能void get(boost::function<void(void)> callback) { callback(); }
。我想在get(boost::bind(/* don't know what to put here*/));
不实现任何其他函数、变量或结构的情况下进行调用,以便回调什么都不做。是否可以在C++03中实现这样的“无操作”回调?
使用 ofboost::bind()
是首选但不是必需的 - 可能是,还有一些其他技巧可以实现我的目标。