[Cs3] Maps x Multimaps question

Mikhail Nesterenko mikhail at cs.kent.edu
Tue Jun 30 22:47:50 EDT 2015


> 
> I dont know the difference in: what upper_bound() and lower_bound() return
> for the two containers: maps and multimaps.
> 
> acording to http://www.cplusplus.com/ , both
> "Returns an iterator pointing to the first element in the container whose
> key is considered to go after k."

lower_bound() returns the iterator to the element with the specified
argument as a key. upper_bound() returns the iterator just past this
key.

Here is an example code.

   http://vega.cs.kent.edu/~mikhail/classes/cs3/Examples/STL/Containers/Associative/multimap.cpp

Thanks,
--
Mikhail


More information about the cs3 mailing list