|
Boost Users : |
Subject: [Boost-users] Compilation errors when trying to use range adaptors with C++11 lambdas
From: Evan Driscoll (driscoll_at_[hidden])
Date: 2012-06-19 14:25:15
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.
Am I doing something wrong, or is this a bug/missing feature/something?
I'm compiling with GCC 4.6.1 (though 4.7.1 has the same problem) and
have Boost 1.49.
The output and full program are attached. The main part (dropping the
"instantiated from..."s) of the first error is:
boost/utility/result_of.hpp:82:8: error: no class template named
result in struct main()::<lambda(int)>
Evan
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