📄 equal_range.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head> <meta name="generator" content= "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org"> <title>equal_range</title> <link href="../cppreference.css" rel="stylesheet" type="text/css"></head><body><table> <tr> <td> <div class="body-content"> <div class="header-box"> <a href="../index.html">cppreference.com</a> > <a href= "index.html">C++ Multimaps</a> > <a href= "equal_range.html">equal_range</a> </div> <div class="name-format"> equal_range </div> <div class="syntax-name-format"> Syntax: </div> <pre class="syntax-box"> #include <map> pair<iterator, iterator> equal_range( const <a href="../containers.html">key_type</a>& key );</pre> <p>The function equal_range() returns two iterators - one to the first element that contains <em>key</em>, another to a point just after the last element that contains <em>key</em>.</p> <p>For example, here is a hypothetical input-configuration loader using multimaps, strings and equal_range():</p> <pre class="example-code"> multimap<string,pair<int,int> > input_config; // read configuration from file "input.conf" to input_config readConfigFile( input_config, "input.conf" ); pair<multimap<string,pair<int,int> >::iterator,multimap<string,pair<int,int> >::iterator> ii; multimap<string,pair<int,int> >::iterator i; ii = input_config.equal_range("key"); // keyboard key-bindings // we can iterate over a range just like with begin() and end() for( i = ii.first; i != ii.second; ++i ) { // add a key binding with this key and output bindkey(i->second.first, i->second.second); } ii = input_config.equal_range("joyb"); // joystick button key-bindings for( i = ii.first; i != ii.second; ++i ) { // add a key binding with this joystick button and output bindjoyb(i->second.first, i->second.second); } </pre> </div> </td> </tr> </table></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -