
20 Jun
2012
20 Jun
'12
6:11 p.m.
On 06/20/2012 09:04 AM, boost-users-request@lists.boost.org wrote:
2012/6/20 Evan Driscoll
: 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