1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>lower_bound</title> 7 <link rel="stylesheet" href="apiReference.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB C++ Standard Template Library API Reference" /> 10 <link rel="up" href="db_map.html" title="Chapter 5. Db_map" /> 11 <link rel="prev" href="stldb_mapfind.html" title="find" /> 12 <link rel="next" href="stldb_mapequal_range.html" title="equal_range" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center"> 19lower_bound 20</th> 21 </tr> 22 <tr> 23 <td width="20%" align="left"><a accesskey="p" href="stldb_mapfind.html">Prev</a> </td> 24 <th width="60%" align="center">Chapter 5. 25 Db_map </th> 26 <td width="20%" align="right"> <a accesskey="n" href="stldb_mapequal_range.html">Next</a></td> 27 </tr> 28 </table> 29 <hr /> 30 </div> 31 <div class="sect1" lang="en" xml:lang="en"> 32 <div class="titlepage"> 33 <div> 34 <div> 35 <h2 class="title" style="clear: both"><a id="stldb_maplower_bound"></a> 36lower_bound 37</h2> 38 </div> 39 </div> 40 </div> 41 <div class="sect2" lang="en" xml:lang="en"> 42 <div class="titlepage"> 43 <div> 44 <div> 45 <h3 class="title"><a id="func_details"></a> 46Function Details</h3> 47 </div> 48 </div> 49 </div> 50 <pre class="programlisting"> 51const_iterator lower_bound(const key_type &x) const 52 </pre> 53 <div class="sect3" lang="en" xml:lang="en"> 54 <div class="titlepage"></div> 55 <p>Find the greatest key less than or equal to x. </p> 56 <p></p> 57 </div> 58 <div class="sect3" lang="en" xml:lang="en"> 59 <div class="titlepage"> 60 <div> 61 <div> 62 <h4 class="title"><a id="id1551981"></a> 63Parameters</h4> 64 </div> 65 </div> 66 </div> 67 <div class="sect4" lang="en" xml:lang="en"> 68 <div class="titlepage"> 69 <div> 70 <div> 71 <h5 class="title"><a id="id1552194"></a> 72 x </h5> 73 </div> 74 </div> 75 </div> 76 <p>The target key to find. </p> 77 </div> 78 </div> 79 <div class="sect3" lang="en" xml:lang="en"> 80 <div class="titlepage"> 81 <div> 82 <div> 83 <h4 class="title"><a id="id1551982"></a> 84Return Value</h4> 85 </div> 86 </div> 87 </div> 88 <p>The valid const iterator sitting on the key, or an invalid one. </p> 89 </div> 90 <div class="sect3" lang="en" xml:lang="en"> 91 <div class="titlepage"> 92 <div> 93 <div> 94 <h4 class="title"><a id="id1552190"></a> 95See Also</h4> 96 </div> 97 </div> 98 </div> 99 <p> 100 </p> 101 <p><a class="ulink" href="http://www.cplusplus.com/reference/stl/map/lower_bound/" target="_top">http://www.cplusplus.com/reference/stl/map/lower_bound/</a> </p> 102 <p> </p> 103 </div> 104 <pre class="programlisting"> 105iterator lower_bound(const key_type &x, 106 bool readonly=false) 107 </pre> 108 <div class="sect3" lang="en" xml:lang="en"> 109 <div class="titlepage"></div> 110 <p>Find the greatest key less than or equal to x. </p> 111 <p></p> 112 </div> 113 <div class="sect3" lang="en" xml:lang="en"> 114 <div class="titlepage"> 115 <div> 116 <div> 117 <h4 class="title"><a id="id1552230"></a> 118Parameters</h4> 119 </div> 120 </div> 121 </div> 122 <div class="sect4" lang="en" xml:lang="en"> 123 <div class="titlepage"> 124 <div> 125 <div> 126 <h5 class="title"><a id="id1552296"></a> 127 x </h5> 128 </div> 129 </div> 130 </div> 131 <p>The target key to find. </p> 132 </div> 133 <div class="sect4" lang="en" xml:lang="en"> 134 <div class="titlepage"> 135 <div> 136 <div> 137 <h5 class="title"><a id="id1552221"></a> 138 readonly </h5> 139 </div> 140 </div> 141 </div> 142 <p>Whether the returned iterator is readonly. </p> 143 </div> 144 </div> 145 <div class="sect3" lang="en" xml:lang="en"> 146 <div class="titlepage"> 147 <div> 148 <div> 149 <h4 class="title"><a id="id1552231"></a> 150Return Value</h4> 151 </div> 152 </div> 153 </div> 154 <p>The valid iterator sitting on the key, or an invalid one. </p> 155 </div> 156 <div class="sect3" lang="en" xml:lang="en"> 157 <div class="titlepage"> 158 <div> 159 <div> 160 <h4 class="title"><a id="id1552393"></a> 161See Also</h4> 162 </div> 163 </div> 164 </div> 165 <p> 166 </p> 167 <p><a class="ulink" href="http://www.cplusplus.com/reference/stl/map/lower_bound/" target="_top">http://www.cplusplus.com/reference/stl/map/lower_bound/</a> </p> 168 <p> </p> 169 </div> 170 </div> 171 <div class="sect2" lang="en" xml:lang="en"> 172 <div class="titlepage"> 173 <div> 174 <div> 175 <h3 class="title"><a id="id1552000"></a> 176Group: Searching Functions</h3> 177 </div> 178 </div> 179 </div> 180 <p>The following functions are returning iterators, and they by default return read-write iterators.</p> 181 <p>If you intend to use the returned iterator only to read, you should call the const version of each function using a const reference to this container. Using const iterators can potentially promote concurrency a lot. You can also set the readonly parameter to each non-const version of the functions to true if you don't use the returned iterator to write, which also promotes concurrency and overall performance. </p> 182 </div> 183 <div class="sect2" lang="en" xml:lang="en"> 184 <div class="titlepage"> 185 <div> 186 <div> 187 <h3 class="title"><a id="id1552098"></a> 188Class</h3> 189 </div> 190 </div> 191 </div> 192 <p> 193 <a class="link" href="db_map.html" title="Chapter 5. Db_map"> 194 db_map</a> 195 </p> 196 </div> 197 </div> 198 <div class="navfooter"> 199 <hr /> 200 <table width="100%" summary="Navigation footer"> 201 <tr> 202 <td width="40%" align="left"><a accesskey="p" href="stldb_mapfind.html">Prev</a> </td> 203 <td width="20%" align="center"> 204 <a accesskey="u" href="db_map.html">Up</a> 205 </td> 206 <td width="40%" align="right"> <a accesskey="n" href="stldb_mapequal_range.html">Next</a></td> 207 </tr> 208 <tr> 209 <td width="40%" align="left" valign="top"> 210find 211 </td> 212 <td width="20%" align="center"> 213 <a accesskey="h" href="index.html">Home</a> 214 </td> 215 <td width="40%" align="right" valign="top"> 216equal_range 217</td> 218 </tr> 219 </table> 220 </div> 221 </body> 222</html> 223