سؤال

I would think it could be useful to store a bound lambda function to be used later, yet I haven't seen any examples on the return value of the boost::lambda::bind function being assigned to an object of that return type. Is there no way to do this cleanly, or is there just no reason to do it?

Example:

boost::lambda::lambda_functor<?> lf = boost::lambda::bind(boost::lambda::constructor<Foo>(), x);
هل كانت مفيدة؟

المحلول

Use boost.Function to store function objects:

boost::function<Foo()> lf = boost::lambda::bind(boost::lambda::constructor<Foo>(), x);
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top