
David Abrahams wrote:
"Maxim Yegorushkin" <e-maxim@yandex.ru> writes:
David Abrahams <dave@boost-consulting.com> wrote:
I wonder, why doesn't boost::lambda::ret<> privide that functionality of boost::make_adaptable<>? It would certainly made sense and saved me and hopefully other people from troubles.
It can't. The result type of the lambda expression depends on its inputs. result_type is only one type. Adaptable functions are fundamentally non-polymorphic.
The result type of ret<R>(expr) is always R. That's what it does. That's _all_ it does. ;-) http://www.boost.org/libs/lambda/doc/ar01s05.html#sect:overriding_deduced_re... The result type of bind<R>(...) is also R, and the TR1 bind requires a ::result_type in this case, but lambda doesn't conform yet.