
11 Apr
2009
11 Apr
'09
7:41 a.m.
I have just started with BLL. The following sample shows where I am stuck: #include <string> #include <cctype> #include <boost/lambda/bind.hpp> #include <boost/lambda/lambda.hpp> int main() { using namespace std; using namespace boost::lambda; string s("hello, world"); for_each(s.begin(), s.end(), _1 = ::toupper(_1)); return 0; } I hit a C2664: cannot convert parameter 1 from 'boost::lambda::placeholder1_type' to 'int'. I am using VS2005. Unfortunately, I do not have access to gcc at the moment to validate this (dig further). Of course, I can get the sample to work if I change the for_each invocation to use a bind: for_each(s.begin(), s.end(), _1 = bind(::toupper, _1)); Regards, Suman