GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing cplusplus.com — std::map::equal_range Reference
map
public member function
<map>
std::map::equal_rangepair<const_iterator,const_iterator> equal_range (const key_type& k) const;pair<iterator,iterator> equal_range (const key_type& k); Get range of equal elements
Because the elements in a map container have unique keys, the range returned will contain a single element at most. If no matches are found, the range returned has a length of zero, with both iterators pointing to the first element that has a key considered to go after k according to the container's internal comparison object (key_comp). Two keys are considered equivalent if the container's comparison object returns false reflexively (i.e., no matter the order in which the keys are passed as arguments). Parameters
Return valueThe function returns a pair, whose member pair::first is the lower bound of the range (the same as lower_bound), and pair::second is the upper bound (the same as upper_bound).If the map object is const-qualified, the function returns a pair of const_iterator. Otherwise, it returns a pair of iterator. Member types iterator and const_iterator are bidirectional iterator types pointing to elements (of type value_type). Notice that value_type in map containers is itself also a pair type: pair<const key_type, mapped_type>. Example
ComplexityLogarithmic in size.Iterator validityNo changes.Data racesThe container is accessed (neither the const nor the non-const versions modify the container).No mapped values are accessed: concurrently accessing or modifying elements is safe. Exception safetyStrong guarantee: if an exception is thrown, there are no changes in the container.See also
Home page | Privacy policy
© cplusplus.com, 2000-2026 - All rights reserved - v3.3.4s Spotted an error? contact us | |||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |