H
Henrique A. Menarin
I want to create a function _and so that I could write
vector<bool> asserts;
//...
bool b = _and(asserts);
and it "anded" all the elements in the vector. I implemented it like
this:
using namespace boost::lambda;
boost::function(bool (vector<boost>)) _and;
_and = bind(ll::accumulate(),
bind(call_begin(), _1),
bind(call_end(), _1),
true,
protect(_1 && _2));
But there is an error with the lambda function protect(_1 && _2).
Does anyone knows what is wrong in this expression?
This syntax is valid for creating similar functions for adding and
multiplying numbers.
vector<bool> asserts;
//...
bool b = _and(asserts);
and it "anded" all the elements in the vector. I implemented it like
this:
using namespace boost::lambda;
boost::function(bool (vector<boost>)) _and;
_and = bind(ll::accumulate(),
bind(call_begin(), _1),
bind(call_end(), _1),
true,
protect(_1 && _2));
But there is an error with the lambda function protect(_1 && _2).
Does anyone knows what is wrong in this expression?
This syntax is valid for creating similar functions for adding and
multiplying numbers.