J
joe
I expected I could construct code like the following:
return *(std::min_element(vec.begin(), vec.end(),
bind(less<double>(),
bind(&entry::foo, _1),
bind(&entry::foo, _2))));
But if vec is only size 1, this returns '0'. min_element should work
on size one vectors.
If I add the guard "if(vec.size() == 1) { return *(vec.begin()); } "
all works fine..
Looking at the implementation code for min_element, this predicate
shouldn't even be called. Any ideas? Is boost messing with this
somehow?
return *(std::min_element(vec.begin(), vec.end(),
bind(less<double>(),
bind(&entry::foo, _1),
bind(&entry::foo, _2))));
But if vec is only size 1, this returns '0'. min_element should work
on size one vectors.
If I add the guard "if(vec.size() == 1) { return *(vec.begin()); } "
all works fine..
Looking at the implementation code for min_element, this predicate
shouldn't even be called. Any ideas? Is boost messing with this
somehow?