Boost logo

Boost Users :

Subject: Re: [Boost-users] Compilation errors when trying to use range adaptors with C++11 lambdas
From: Akira Takahashi (faithandbrave_at_[hidden])
Date: 2012-06-19 21:08:03


Hi Evan,

2012/6/20 Evan Driscoll <driscoll_at_[hidden]>:
> 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.

>>========================
Akira Takahashi
mailto:faithandbrave_at_[hidden]
https://sites.google.com/site/faithandbrave/about/en


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net