1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>qbegin(Predicates const &)</title> 5<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../../../index.html" title="Chapter 1. Geometry"> 8<link rel="up" href="../boost__geometry__index__rtree.html" title="boost::geometry::index::rtree"> 9<link rel="prev" href="query_predicates_const____outiter_.html" title="query(Predicates const &, OutIter)"> 10<link rel="next" href="qend__.html" title="qend()"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="query_predicates_const____outiter_.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost__geometry__index__rtree.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="qend__.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h5 class="title"> 27<a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___"></a><a name="classboost_1_1geometry_1_1index_1_1rtree_1a874f43d4119f552a613f051c6177b9d8"></a><a class="link" href="qbegin_predicates_const___.html" title="qbegin(Predicates const &)">qbegin(Predicates 28 const &)</a> 29</h5></div></div></div> 30<p> 31 <a class="indexterm" name="idm45635675732256"></a> 32Returns a query iterator pointing at the begin of the query range. 33 </p> 34<h6> 35<a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.h0"></a> 36 <span class="phrase"><a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.description"></a></span><a class="link" href="qbegin_predicates_const___.html#geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.description">Description</a> 37 </h6> 38<p> 39 This method returns an iterator which may be used to perform iterative 40 queries. For the information about predicates which may be passed to 41 this method see <a class="link" href="query_predicates_const____outiter_.html#classboost_1_1geometry_1_1index_1_1rtree_1ace0ba7f3280b1074cea31b4f1bc1d7ea">query()</a>. 42 </p> 43<h6> 44<a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.h1"></a> 45 <span class="phrase"><a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.synopsis"></a></span><a class="link" href="qbegin_predicates_const___.html#geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.synopsis">Synopsis</a> 46 </h6> 47<pre class="programlisting"><code class="computeroutput"><span class="keyword">template</span><span class="special"><</span></code><code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">Predicates</span></code><code class="computeroutput"><span class="special">></span></code> 48<code class="literal"><a class="link" href="../boost__geometry__index__rtree.html#classboost_1_1geometry_1_1index_1_1rtree_1ad144a7704ad878caaa84cda79b140855">const_query_iterator</a></code> <code class="computeroutput"><span class="identifier">qbegin</span></code><code class="computeroutput"><span class="special">(</span></code><code class="computeroutput"><span class="identifier">Predicates</span> <span class="keyword">const</span> <span class="special">&</span></code> <code class="computeroutput"><span class="identifier">predicates</span></code><code class="computeroutput"><span class="special">)</span></code> 49</pre> 50<h6> 51<a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.h2"></a> 52 <span class="phrase"><a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.modifier_s_"></a></span><a class="link" href="qbegin_predicates_const___.html#geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.modifier_s_">Modifier(s)</a> 53 </h6> 54<p> 55</p> 56<pre class="programlisting"><span class="keyword">const</span></pre> 57<p> 58 </p> 59<h6> 60<a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.h3"></a> 61 <span class="phrase"><a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.parameter_s_"></a></span><a class="link" href="qbegin_predicates_const___.html#geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.parameter_s_">Parameter(s)</a> 62 </h6> 63<div class="informaltable"><table class="table"> 64<colgroup> 65<col> 66<col> 67<col> 68</colgroup> 69<thead><tr> 70<th> 71 <p> 72 Type 73 </p> 74 </th> 75<th> 76 <p> 77 Name 78 </p> 79 </th> 80<th> 81 <p> 82 Description 83 </p> 84 </th> 85</tr></thead> 86<tbody><tr> 87<td> 88 <p> 89 <code class="computeroutput"><span class="identifier">Predicates</span> <span class="keyword">const</span> <span class="special">&</span></code> 90 </p> 91 </td> 92<td> 93 <p> 94 <code class="computeroutput"><span class="identifier">predicates</span></code> 95 </p> 96 </td> 97<td> 98 <p> 99 Predicates. 100 </p> 101 </td> 102</tr></tbody> 103</table></div> 104<h6> 105<a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.h4"></a> 106 <span class="phrase"><a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.returns"></a></span><a class="link" href="qbegin_predicates_const___.html#geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.returns">Returns</a> 107 </h6> 108<p> 109 The iterator pointing at the begin of the query range. 110 </p> 111<h6> 112<a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.h5"></a> 113 <span class="phrase"><a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.example"></a></span><a class="link" href="qbegin_predicates_const___.html#geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.example">Example</a> 114 </h6> 115<p> 116</p> 117<pre class="programlisting"><span class="keyword">for</span> <span class="special">(</span> <span class="identifier">Rtree</span><span class="special">::</span><span class="identifier">const_query_iterator</span> <span class="identifier">it</span> <span class="special">=</span> <span class="identifier">tree</span><span class="special">.</span><span class="identifier">qbegin</span><span class="special">(</span><span class="identifier">bgi</span><span class="special">::</span><span class="identifier">nearest</span><span class="special">(</span><span class="identifier">pt</span><span class="special">,</span> <span class="number">10000</span><span class="special">))</span> <span class="special">;</span> 118 <span class="identifier">it</span> <span class="special">!=</span> <span class="identifier">tree</span><span class="special">.</span><span class="identifier">qend</span><span class="special">()</span> <span class="special">;</span> <span class="special">++</span><span class="identifier">it</span> <span class="special">)</span> 119<span class="special">{</span> 120 <span class="comment">// do something with value</span> 121 <span class="keyword">if</span> <span class="special">(</span> <span class="identifier">has_enough_nearest_values</span><span class="special">()</span> <span class="special">)</span> 122 <span class="keyword">break</span><span class="special">;</span> 123<span class="special">}</span> 124 125<span class="comment">// C++11 (auto)</span> 126<span class="keyword">for</span> <span class="special">(</span> <span class="keyword">auto</span> <span class="identifier">it</span> <span class="special">=</span> <span class="identifier">tree</span><span class="special">.</span><span class="identifier">qbegin</span><span class="special">(</span><span class="identifier">bgi</span><span class="special">::</span><span class="identifier">nearest</span><span class="special">(</span><span class="identifier">pt</span><span class="special">,</span> <span class="number">3</span><span class="special">))</span> <span class="special">;</span> <span class="identifier">it</span> <span class="special">!=</span> <span class="identifier">tree</span><span class="special">.</span><span class="identifier">qend</span><span class="special">()</span> <span class="special">;</span> <span class="special">++</span><span class="identifier">it</span> <span class="special">)</span> 127<span class="special">{</span> 128 <span class="comment">// do something with value</span> 129<span class="special">}</span> 130 131<span class="comment">// C++14 (generic lambda expression)</span> 132<span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">tree</span><span class="special">.</span><span class="identifier">qbegin</span><span class="special">(</span><span class="identifier">bgi</span><span class="special">::</span><span class="identifier">nearest</span><span class="special">(</span><span class="identifier">pt</span><span class="special">,</span> <span class="number">3</span><span class="special">)),</span> <span class="identifier">tree</span><span class="special">.</span><span class="identifier">qend</span><span class="special">(),</span> <span class="special">[](</span><span class="keyword">auto</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">val</span><span class="special">){</span> 133 <span class="comment">// do something with value</span> 134<span class="special">});</span> 135</pre> 136<p> 137 </p> 138<h6> 139<a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.h6"></a> 140 <span class="phrase"><a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.iterator_category"></a></span><a class="link" href="qbegin_predicates_const___.html#geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.iterator_category">Iterator 141 category</a> 142 </h6> 143<p> 144 ForwardIterator 145 </p> 146<h6> 147<a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.h7"></a> 148 <span class="phrase"><a name="geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.throws"></a></span><a class="link" href="qbegin_predicates_const___.html#geometry.reference.spatial_indexes.boost__geometry__index__rtree.qbegin_predicates_const___.throws">Throws</a> 149 </h6> 150<p> 151 If predicates copy throws. If allocation throws. 152 </p> 153<div class="warning"><table border="0" summary="Warning"> 154<tr> 155<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../../../../../../doc/src/images/warning.png"></td> 156<th align="left">Warning</th> 157</tr> 158<tr><td align="left" valign="top"><p> 159 The modification of the rtree may invalidate the iterators. 160 </p></td></tr> 161</table></div> 162</div> 163<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 164<td align="left"></td> 165<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam 166 Wulkiewicz, Oracle and/or its affiliates<p> 167 Distributed under the Boost Software License, Version 1.0. (See accompanying 168 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 169 </p> 170</div></td> 171</tr></table> 172<hr> 173<div class="spirit-nav"> 174<a accesskey="p" href="query_predicates_const____outiter_.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost__geometry__index__rtree.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="qend__.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 175</div> 176</body> 177</html> 178