23 Jun
2010
23 Jun
'10
3:51 p.m.
Is this a homework? I hope not :-)
I had done all my homeworks many years ago :).
What I use is get an upper_bound and decrement the iterator. Of course, depending on the situation, you may also use reverse ordering and lower_bound.
Ok, thanks. I just thought there might be some more direct & elegant way that I missed.