Thanks. I would like to use your suggestion (since it
is simpler/cleaner).
however, you said 'you just need to
proceed from the iterator
lower_bound returns until you hit an element with
.first != x (or end()). '
How can I find the element with .first != x?
I try using end(), but it does not work. it copies
evething from (.fires == x) to the end of the list.
--- Peter Dimov
yinglcs2@yahoo.com wrote:
I am not sure how low_bound() will work. My understanding is it only return the ** first ** instance.
But so does find_if.
but I am looking for ** all instances ** which fit the condition (i.e. the first value of the key pair matches the input parameter).
Since a map is sorted by its key, you just need to proceed from the iterator lower_bound returns until you hit an element with .first != x (or end()). Anyway, ...
iterator& itr = find_if(myMap.begin(),
... you need to omit the reference here.
iterator itr = find_if( ...
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com