mirror of
https://github.com/boostorg/multi_index.git
synced 2025-05-09 23:14:04 +00:00
doc improvement as per http://lists.boost.org/Archives/boost/2014/11/217502.php
This commit is contained in:
parent
d45c8e0991
commit
e18ece1ec1
@ -474,6 +474,18 @@ means of user-defined <code>typedef</code>s:
|
|||||||
<span class=identifier>es</span><span class=special>.</span><span class=identifier>get</span><span class=special><</span><span class=number>1</span><span class=special>>().</span><span class=identifier>find</span><span class=special>(</span><span class=string>"Judy Smith"</span><span class=special>);</span>
|
<span class=identifier>es</span><span class=special>.</span><span class=identifier>get</span><span class=special><</span><span class=number>1</span><span class=special>>().</span><span class=identifier>find</span><span class=special>(</span><span class=string>"Judy Smith"</span><span class=special>);</span>
|
||||||
</pre></blockquote>
|
</pre></blockquote>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The iterators provided by every index are <i>constant</i>, that is, the elements they point to
|
||||||
|
cannot be mutated directly. This follows the interface of <code>std::set</code> for ordered
|
||||||
|
indices but might come as a surprise for other types such as sequenced indices, which are modeled after
|
||||||
|
<code>std::list</code>, where this limitation does not happen. This seemingly odd behavior
|
||||||
|
is imposed by the way <code>multi_index_container</code>s work; if elements were
|
||||||
|
allowed to be mutated indiscriminately, we could introduce inconsistencies
|
||||||
|
in the ordered indices of the <code>multi_index_container</code> without the container
|
||||||
|
being notified about it. Element modification is properly done by means of
|
||||||
|
<a href="#ord_updating">update operations</a> on any index.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h2>
|
<h2>
|
||||||
<a name="index_types">Index types</a>
|
<a name="index_types">Index types</a>
|
||||||
</h2>
|
</h2>
|
||||||
@ -1060,9 +1072,8 @@ same way as <code>std::list</code> permits. The interface of sequenced indices
|
|||||||
is thus designed upon that of <code>std::list</code>; nearly every operation
|
is thus designed upon that of <code>std::list</code>; nearly every operation
|
||||||
provided in the standard container is replicated here, occasionally with changes
|
provided in the standard container is replicated here, occasionally with changes
|
||||||
in the syntax and/or semantics to cope with the constraints imposed by
|
in the syntax and/or semantics to cope with the constraints imposed by
|
||||||
Boost.MultiIndex. In particular, there is an important limitation of sequenced
|
Boost.MultiIndex. An important difference, commented <a href="#iterator_access">above</a>,
|
||||||
indices with respect to <code>std::list</code>s, namely that elements of an
|
is the fact that sequenced index iterators are <i>constant</i>:
|
||||||
<code>multi_index_container</code> are not mutable through an iterator:
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<blockquote><pre>
|
<blockquote><pre>
|
||||||
@ -1076,11 +1087,7 @@ indices with respect to <code>std::list</code>s, namely that elements of an
|
|||||||
</pre></blockquote>
|
</pre></blockquote>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
That is, iterators of a sequenced index (of all types of indices, actually)
|
As with any other type of index, element modification
|
||||||
point to constant elements. This limitation might come as a surprise, but
|
|
||||||
it is imposed by the way <code>multi_index_container</code>s work; if elements were
|
|
||||||
allowed to be changed in this manner, we could introduce inconsistencies
|
|
||||||
in other ordered indices of the <code>multi_index_container</code>. Element modification
|
|
||||||
can nevertheless be done by means of
|
can nevertheless be done by means of
|
||||||
<a href="#seq_updating">update operations</a>.
|
<a href="#seq_updating">update operations</a>.
|
||||||
</p>
|
</p>
|
||||||
@ -1240,9 +1247,9 @@ Index types
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<p>Revised November 7th 2008</p>
|
<p>Revised November 11th 2014</p>
|
||||||
|
|
||||||
<p>© Copyright 2003-2008 Joaquín M López Muñoz.
|
<p>© Copyright 2003-2014 Joaquín M López Muñoz.
|
||||||
Distributed under the Boost Software
|
Distributed under the Boost Software
|
||||||
License, Version 1.0. (See accompanying file <a href="../../../../LICENSE_1_0.txt">
|
License, Version 1.0. (See accompanying file <a href="../../../../LICENSE_1_0.txt">
|
||||||
LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">
|
LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user