|
Boost Users : |
From: Sohail Somani (s.somani_at_[hidden])
Date: 2006-07-25 17:19:16
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
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