将boost::lambda::bind的返回值赋给object

Assign object the return value of boost::lambda::bind?

本文关键字:返回值 object bind boost lambda      更新时间:2023-10-16

我认为存储一个绑定lambda函数以供以后使用可能是有用的,但我还没有看到任何关于将boost::lambda::bind函数的返回值分配给该返回类型的对象的示例。是没有办法干净利落地做这件事,还是根本没有理由这么做?

的例子:

boost::lambda::lambda_functor<?> lf = boost::lambda::bind(boost::lambda::constructor<Foo>(), x);

使用boost。存储函数对象的函数:

boost::function<Foo()> lf = boost::lambda::bind(boost::lambda::constructor<Foo>(), x);