By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,506 Members | 1,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,506 IT Pros & Developers. It's quick & easy.

Interesting Boost::bind error?

P: n/a
I expected I could construct code like the following:

return *(std::min_element(vec.begin(), vec.end(),
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
Mar 10 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.