Imported Upstream version 1.57.0
[platform/upstream/boost.git] / doc / html / intrusive / equal_range_stability.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Stability and insertion with hint in ordered associative containers with equivalent keys</title>
5 <link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
8 <link rel="up" href="../intrusive.html" title="Chapter&#160;15.&#160;Boost.Intrusive">
9 <link rel="prev" href="scary_iterators.html" title="Scary Iterators">
10 <link rel="next" href="obtaining_same_type_reducing_space.html" title="Obtaining the same types and reducing symbol length">
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="scary_iterators.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../intrusive.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="obtaining_same_type_reducing_space.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="section">
26 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
27 <a name="intrusive.equal_range_stability"></a><a class="link" href="equal_range_stability.html" title="Stability and insertion with hint in ordered associative containers with equivalent keys">Stability and insertion
28     with hint in ordered associative containers with equivalent keys</a>
29 </h2></div></div></div>
30 <p>
31       <span class="bold"><strong>Boost.Intrusive</strong></span> ordered associative containers
32       with equivalent keys offer stability guarantees, following <a href="http://open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#233" target="_top">C++
33       standard library's defect #233 resolution</a>, explained in document <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1780.html" target="_top">Comments
34       on LWG issue 233: Insertion hints in associative containers</a>. This means
35       that:
36     </p>
37 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
38 <li class="listitem">
39           A <span class="emphasis"><em>Insert without hint</em></span> member function always insert
40           at the upper bound of an equal range.
41         </li>
42 <li class="listitem">
43           A <span class="emphasis"><em>Insert with hint</em></span> member function inserts the new
44           value <span class="bold"><strong>before the hint</strong></span> if hint's and new
45           node's keys are equivalent.
46         </li>
47 <li class="listitem">
48           Implements Andrew Koenig <span class="emphasis"><em>as close as possible to hint</em></span>
49           proposal. A new element is always be inserted as close to the hint as possible.
50           So, for example, if there is a subsequence of equivalent values, <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span></code> as the hint means that the new element
51           should be inserted before the subsequence even if <code class="computeroutput"><span class="identifier">a</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span></code> is far away. This allows code to always
52           append (or prepend) an equal range with something as simple as: <code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span><span class="identifier">m</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">new_node</span><span class="special">);</span></code>
53           or <code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">insert</span><span class="special">(</span><span class="identifier">m</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">new_node</span><span class="special">);</span></code>
54         </li>
55 </ul></div>
56 </div>
57 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
58 <td align="left"></td>
59 <td align="right"><div class="copyright-footer">Copyright &#169; 2005 Olaf Krzikalla<br>Copyright &#169; 2006-2013 Ion Gaztanaga<p>
60         Distributed under the Boost Software License, Version 1.0. (See accompanying
61         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>)
62       </p>
63 </div></td>
64 </tr></table>
65 <hr>
66 <div class="spirit-nav">
67 <a accesskey="p" href="scary_iterators.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../intrusive.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="obtaining_same_type_reducing_space.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
68 </div>
69 </body>
70 </html>