|
Boost Users : |
From: Maximilian W. (wilson.max_at_[hidden])
Date: 2004-08-31 13:36:09
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 <stdlib.h>
#include <boost/lambda/lambda.hpp>
#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 <stdlib.h>
#include "/users/user2/ugrad/m/mdw45/boost_1_31_0/boost/lambda/lambda.hpp"
#include <testIf.h>
#include <vector>
#include <easylist.hpp>
#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
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