FW: [Lambda] find_if + vector of arrays

Hi, I'm forwarding this here as I didn't get a reply on the users list.
-----Original Message----- From: Sohail Somani Sent: Tuesday, July 25, 2006 2:19 PM To: 'boost-users@lists.boost.org' Subject: [Lambda] find_if + vector of arrays
Hi,
Why can't lambda figure out the return type of operator[] for array? Does it know about vectors? I know I can fix the compile error by using bl::ret<double>(bl::_1[0])... But for obvious reasons, I'd much rather not!
#include <vector> #include <algorithm>
#include <boost/array.hpp> #include <boost/lambda/lambda.hpp>
int main() { namespace bl=boost::lambda; using std::vector; using boost::array;
array<double,3> cpy = {1}; vector<vector<double> > a(10,vector<double>(3,1)); vector<array<double,3> > b(10,cpy);
std::find_if(a.begin(),a.end(),bl::_1[0]==5); std::find_if(b.begin(),b.end(),bl::_1[0]==5); }
Thanks!
Sohail
participants (1)
-
Sohail Somani