J
joe
I'm having an annoyance with a boost::bind failure that I can't figure
out. I'm using an iterator and have all the required fields for
iterator (value_type, etc).
I'm trying to call the function:
find(obj.begin(),
obj.end(),
boost::bind(std::greater<double>(), _1, 4.4);
which gives the error:
stl_algo.h:172: error: no match for 'operator==' in (&_first)-
I'm surprised this fails, because all the following work fine:
double a = *obj.begin();
double b = *obj.begin();
and most telling:
bool a = (*obj.begin() == 4.4);
since the code in stl_algo.h is doing exactly that. What could boost
be doing to the _1 placeholder? I assumed it did little more than use
operator* on each iterator as it is passed them.
Any ideas?
out. I'm using an iterator and have all the required fields for
iterator (value_type, etc).
I'm trying to call the function:
find(obj.begin(),
obj.end(),
boost::bind(std::greater<double>(), _1, 4.4);
which gives the error:
stl_algo.h:172: error: no match for 'operator==' in (&_first)-
MyIter<T>:perator* [with T = double]() == __val'
I'm surprised this fails, because all the following work fine:
double a = *obj.begin();
double b = *obj.begin();
and most telling:
bool a = (*obj.begin() == 4.4);
since the code in stl_algo.h is doing exactly that. What could boost
be doing to the _1 placeholder? I assumed it did little more than use
operator* on each iterator as it is passed them.
Any ideas?