Hi, newbie here. I'm trying to learn the boost lambda library in
simple steps, and am getting an error in the following snippet.
Apparently, lambda now only allows format& objects as arguments to
cout. This puzzles me because all the documentation I've seen on BLL
has examples very much like what I"m using. Has there been a design
change? Does anyone know what's going on?
Thanks in advance.
Max Wilson
#include <iostream>
#include
#include
#include <vector>
#include <algorithm>
using namespace std;
using namespace boost::lambda;
int main(int argc, char *argv[]) {
vector<int> vec;
vec.push_back(1);
vec.push_back(2);
for_each(vec.begin(), vec.end(), cout << _1 << endl);
return 0;
}
#include <iostream>
#include
#include "/users/user2/ugrad/m/mdw45/boost_1_31_0/boost/lambda/lambda.hpp"
#include
#include <vector>
#include
#include <algorithm>
using namespace std;
using namespace boost::lambda;
int main(int argc, char *argv[]) {
vector<int> vec;
vec.push_back(1);
vec.push_back(2);
for_each(vec.begin(), vec.end(), cout << _1 << endl);
return 0; }
--
Sometimes I think decisions through, weigh the consequences, decide
it is not a good idea, but blind myself and make it anyway. I do not
think this is a good thing to do, but it might be. Humans are
endowed with both reason and emotion for a reason.
-Tara Greenwood