On 06/20/2012 09:04 AM,
boost-use...@lists.boost.org wrote:
> 2012/6/20 Evan Driscoll<
dris...@cs.wisc.edu>:
>> When trying to compile the following:
>>
>> std::vector<int> v;
>> v | boost::adaptors::transformed([] (int x) { return x; });
>>
>> I get a bunch of compile errors. If I replace the lambda with a function
>> defined normally, it works.
>
> You must use
> #define BOOST_RESULT_OF_USE_DECLTYPE
>
> C++11 lambda can't apply non decltype-base result_of.
Thanks a lot; worked like a charm. Of course, in the interim I figured
out that the function will be rather more complicated than I thought so
I'm happier with it defined normally, but that'll be good to file away
for future reference. :-)
Evan