mirror of
https://github.com/boostorg/multi_index.git
synced 2025-05-09 02:44:12 +00:00
copied content from develop after wrongly made merge
This commit is contained in:
parent
3239677c40
commit
86d7b3ef6e
@ -172,6 +172,13 @@ hashed indices update functions</a> so that they meet some intuitive expectation
|
||||
Grzegorz Jakacki spotted some internal dead code.
|
||||
</p>
|
||||
|
||||
<h2><a name="boost_1_56">Boost 1.56 release</a></h2>
|
||||
|
||||
<p>
|
||||
Stephen Kelly has contributed the removal of workaround code for old compilers
|
||||
no longer supported.
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="prev_link"><a href="release_notes.html"><img src="prev.gif" alt="release notes" border="0"><br>
|
||||
@ -185,9 +192,9 @@ Index
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised June 25th 2008</p>
|
||||
<p>Revised October 9th 2013</p>
|
||||
|
||||
<p>© Copyright 2003-2008 Joaquín M López Muñoz.
|
||||
<p>© Copyright 2003-2013 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
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">
|
||||
|
@ -114,25 +114,21 @@ of symbol names.
|
||||
<th>class template</th>
|
||||
<th>limiting macro</th>
|
||||
<th>default value</th>
|
||||
<th>default value<br>(MSVC++ 6.0)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"> <code>indexed_by</code> </td>
|
||||
<td align="center"> <code>BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE</code> </td>
|
||||
<td align="center">20</td>
|
||||
<td align="center">5</td>
|
||||
</tr>
|
||||
<tr class="odd_tr">
|
||||
<td align="center"> <code>tag</code> </td>
|
||||
<td align="center"> <code>BOOST_MULTI_INDEX_LIMIT_TAG_SIZE</code> </td>
|
||||
<td align="center">20</td>
|
||||
<td align="center">3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"> <code>composite_key</code> </td>
|
||||
<td align="center"> <code>BOOST_MULTI_INDEX_LIMIT_COMPOSITE_KEY_SIZE</code> </td>
|
||||
<td align="center">10</td>
|
||||
<td align="center">5</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
@ -198,7 +194,7 @@ in the final type by encapsulating it into another, shorter-named construct:
|
||||
|
||||
<blockquote><pre>
|
||||
<span class=comment>// reducing symbol names through type hiding
|
||||
// type hide the index spexifier list within employee_set_indices</span>
|
||||
// type hide the index specifier list within employee_set_indices</span>
|
||||
|
||||
<span class=keyword>struct</span> <span class=identifier>employee_set_indices</span><span class=special>:</span>
|
||||
<span class=identifier>indexed_by</span><span class=special><</span>
|
||||
@ -372,7 +368,7 @@ Performance
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised July 30th 2013</p>
|
||||
<p>Revised November 12th 2013</p>
|
||||
|
||||
<p>© Copyright 2003-2013 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
|
@ -13,8 +13,8 @@
|
||||
<h1><img src="../../../boost.png" alt="boost.png (6897 bytes)" align=
|
||||
"middle" width="277" height="86">Boost Multi-index Containers Library</h1>
|
||||
|
||||
<div class="prev_link"></div>
|
||||
<div class="up_link"></div>
|
||||
<div class="prev_link"> </div>
|
||||
<div class="up_link"> </div>
|
||||
<div class="next_link"><a href="tutorial/index.html"><img src="next.gif" alt="tutorial" border="0"><br>
|
||||
Tutorial
|
||||
</a></div><br clear="all" style="clear: all;">
|
||||
@ -77,17 +77,17 @@ examples of use developed in the documentation:
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="prev_link"></div>
|
||||
<div class="up_link"></div>
|
||||
<div class="prev_link"> </div>
|
||||
<div class="up_link"> </div>
|
||||
<div class="next_link"><a href="tutorial/index.html"><img src="next.gif" alt="tutorial" border="0"><br>
|
||||
Tutorial
|
||||
</a></div><br clear="all" style="clear: all;">
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised February 6th 2006</p>
|
||||
<p>Revised November 30th 2013</p>
|
||||
|
||||
<p>© Copyright 2003-2006 Joaquín M López Muñoz.
|
||||
<p>© Copyright 2003-2013 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
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">
|
||||
|
@ -50,6 +50,7 @@ Sequenced indices
|
||||
<li><a href="#lookup">Lookup</a></li>
|
||||
<li><a href="#bucket_interface">Bucket interface</a></li>
|
||||
<li><a href="#hash_policy">Hash policy</a></li>
|
||||
<li><a href="#comparison">Comparison</a></li>
|
||||
<li><a href="#serialization">Serialization</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@ -118,6 +119,13 @@ their associated <a href="#hash_indices">hashed index</a> classes.
|
||||
|
||||
<span class=keyword>template</span><span class=special><</span><b>implementation defined</b><span class=special>></span> <span class=keyword>class</span> <b>index class name implementation defined</b><span class=special>;</span>
|
||||
|
||||
<span class=comment>// index comparison:</span>
|
||||
|
||||
<span class=comment>// <b>OP</b> is any of ==,!=</span>
|
||||
|
||||
<span class=keyword>template</span><span class=special><</span><b>implementation defined</b><span class=special>></span>
|
||||
<span class=keyword>bool</span> <span class=keyword>operator</span> <b><i>OP</i></b><span class=special>(</span><span class=keyword>const</span> <b>index class name</b><span class=special>&</span> <span class=identifier>x</span><span class=special>,</span><span class=keyword>const</span> <b>index class name</b><span class=special>&</span> <span class=identifier>y</span><span class=special>);</span>
|
||||
|
||||
<span class=comment>// index specialized algorithms:</span>
|
||||
|
||||
<span class=keyword>template</span><span class=special><</span><b>implementation defined</b><span class=special>></span>
|
||||
@ -238,20 +246,20 @@ requirements.
|
||||
<b>index class name</b><span class=special>&</span> <span class=keyword>operator</span><span class=special>=(</span><span class=keyword>const</span> <b>index class name</b><span class=special>&</span> <span class=identifier>x</span><span class=special>);</span>
|
||||
<b>index class name</b><span class=special>&</span> <span class=keyword>operator</span><span class=special>=(</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>initializer_list</span><span class=special><</span><span class=identifier>value_type</span><span class=special>></span> <span class=identifier>list</span><span class=special>);</span>
|
||||
|
||||
<span class=identifier>allocator_type</span> <span class=identifier>get_allocator</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>allocator_type</span> <span class=identifier>get_allocator</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// size and capacity:</span>
|
||||
|
||||
<span class=keyword>bool</span> <span class=identifier>empty</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>size</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>max_size</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=keyword>bool</span> <span class=identifier>empty</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>size</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>max_size</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// iterators:</span>
|
||||
|
||||
<span class=identifier>iterator</span> <span class=identifier>begin</span><span class=special>();</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>begin</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>iterator</span> <span class=identifier>end</span><span class=special>();</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>end</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>iterator</span> <span class=identifier>begin</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>begin</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>iterator</span> <span class=identifier>end</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>end</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>cbegin</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>cend</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
|
||||
@ -286,7 +294,7 @@ requirements.
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>typename</span> <span class=identifier>Modifier</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Rollback</span><span class=special>></span>
|
||||
<span class=keyword>bool</span> <span class=identifier>modify_key</span><span class=special>(</span><span class=identifier>iterator</span> <span class=identifier>position</span><span class=special>,</span><span class=identifier>Modifier</span> <span class=identifier>mod</span><span class=special>,</span><span class=identifier>Rollback</span> <span class=identifier>back</span><span class=special>);</span>
|
||||
|
||||
<span class=keyword>void</span> <span class=identifier>clear</span><span class=special>();</span>
|
||||
<span class=keyword>void</span> <span class=identifier>clear</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=keyword>void</span> <span class=identifier>swap</span><span class=special>(</span><b>index class name</b><span class=special>&</span> <span class=identifier>x</span><span class=special>);</span>
|
||||
|
||||
<span class=comment>// observers:</span>
|
||||
@ -326,8 +334,8 @@ requirements.
|
||||
|
||||
<span class=comment>// bucket interface:</span>
|
||||
|
||||
<span class=identifier>size_type</span> <span class=identifier>bucket_count</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>max_bucket_count</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>bucket_count</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>max_bucket_count</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>bucket_size</span><span class=special>(</span><span class=identifier>size_type</span> <span class=identifier>n</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>bucket</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>key_type</span><span class=special>&</span> <span class=identifier>k</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
|
||||
@ -343,12 +351,24 @@ requirements.
|
||||
|
||||
<span class=comment>// hash policy:</span>
|
||||
|
||||
<span class=keyword>float</span> <span class=identifier>load_factor</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=keyword>float</span> <span class=identifier>max_load_factor</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=keyword>float</span> <span class=identifier>load_factor</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=keyword>float</span> <span class=identifier>max_load_factor</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=keyword>void</span> <span class=identifier>max_load_factor</span><span class=special>(</span><span class=keyword>float</span> <span class=identifier>z</span><span class=special>);</span>
|
||||
<span class=keyword>void</span> <span class=identifier>rehash</span><span class=special>(</span><span class=identifier>size_type</span> <span class=identifier>n</span><span class=special>);</span>
|
||||
<span class=keyword>void</span> <span class=identifier>reserve</span><span class=special>(</span><span class=identifier>size_type</span> <span class=identifier>n</span><span class=special>);</span>
|
||||
<span class=special>};</span>
|
||||
|
||||
<span class=comment>// index comparison:</span>
|
||||
|
||||
<span class=keyword>template</span><span class=special><</span><b>implementation defined</b><span class=special>></span>
|
||||
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>==(</span><span class=keyword>const</span> <b>index class name</b><span class=special>&</span> <span class=identifier>x</span><span class=special>,</span><span class=keyword>const</span> <b>index class name</b><span class=special>&</span> <span class=identifier>y</span><span class=special>)</span><span class=special>;</span>
|
||||
|
||||
<span class=keyword>template</span><span class=special><</span><b>implementation defined</b><span class=special>></span>
|
||||
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>!=(</span><span class=keyword>const</span> <b>index class name</b><span class=special>&</span> <span class=identifier>x</span><span class=special>,</span><span class=keyword>const</span> <b>index class name</b><span class=special>&</span> <span class=identifier>y</span><span class=special>)</span>
|
||||
<span class=special>{</span>
|
||||
<span class=keyword>return</span> <span class=special>!(</span><span class=identifier>x</span><span class=special>==</span><span class=identifier>y</span><span class=special>);</span>
|
||||
<span class=special>}</span>
|
||||
|
||||
<span class=comment>// index specialized algorithms:</span>
|
||||
|
||||
<span class=keyword>template</span><span class=special><</span><b>implementation defined</b><span class=special>></span>
|
||||
@ -370,21 +390,22 @@ scheme outlined in the
|
||||
section</a>. The complexity signature of hashed indices is:
|
||||
<ul>
|
||||
<li>copying: <code>c(n)=n*log(n)</code>,</li>
|
||||
<li>insertion: average case <code>i(n)=1</code> (constant),
|
||||
worst case <code>i(n)=n</code>,</li>
|
||||
<li>hinted insertion: average case <code>h(n)=1</code> (constant),
|
||||
worst case <code>h(n)=n</code>,</li>
|
||||
<li>deletion: average case <code>d(n)=1</code> (constant),
|
||||
worst case <code>d(n)=n</code>,</li>
|
||||
<li>insertion: average case <code>i(n)=1</code> (amortized constant),
|
||||
worst case <code>i(n)=n<sub>dist</sub></code>,</li>
|
||||
<li>hinted insertion: average case <code>h(n)=1</code> (amortized constant),
|
||||
worst case <code>h(n)=n<sub>dist</sub></code>,</li>
|
||||
<li>deletion: <code>d(n)=1</code> (constant),</li>
|
||||
<li>replacement:
|
||||
<ul>
|
||||
<li>if the new element key is equivalent to the original, <code>r(n)=1</code> (constant),</li>
|
||||
<li>otherwise, average case <code>r(n)=1</code> (constant),
|
||||
worst case <code>r(n)=n</code>,</li>
|
||||
worst case <code>r(n)=n<sub>dist</sub></code>,</li>
|
||||
</ul></li>
|
||||
<li>modifying: average case <code>m(n)=1</code> (constant),
|
||||
worst case <code>m(n)=n</code>.</li>
|
||||
worst case <code>m(n)=n<sub>dist</sub></code>,</li>
|
||||
</ul>
|
||||
where <code>n<sub>dist</sub></code> is the number of non-equivalent elements out of
|
||||
the total <code>n</code>.
|
||||
</p>
|
||||
|
||||
<h4><a name="instantiation_types">Instantiation types</a></h4>
|
||||
@ -504,7 +525,7 @@ is <code>true</code> if and only if insertion took place. On successful insertio
|
||||
points to an element that caused the insertion to be banned. Note that more than
|
||||
one element can be causing insertion not to be allowed.<br>
|
||||
<b>Complexity:</b> <code>O(I(n))</code>.<br>
|
||||
<b>Exception safety:</b> Strong.<br>
|
||||
<b>Exception safety:</b> Strong, except that rehashing may occur even if the operation fails.<br>
|
||||
</blockquote>
|
||||
|
||||
<code>template<typename... Args><br>
|
||||
@ -530,7 +551,7 @@ element. Otherwise, an iterator to an element that caused the insertion to be
|
||||
banned. Note that more than one element can be causing insertion not to be
|
||||
allowed.<br>
|
||||
<b>Complexity:</b> <code>O(H(n))</code>.<br>
|
||||
<b>Exception safety:</b> Strong.<br>
|
||||
<b>Exception safety:</b> Strong, except that rehashing may occur even if the operation fails.<br>
|
||||
</blockquote>
|
||||
|
||||
<code>std::pair<iterator,bool> insert(const value_type& x);</code><br>
|
||||
@ -555,7 +576,7 @@ is <code>true</code> if and only if insertion took place. On successful insertio
|
||||
points to an element that caused the insertion to be banned. Note that more than
|
||||
one element can be causing insertion not to be allowed.<br>
|
||||
<b>Complexity:</b> <code>O(I(n))</code>.<br>
|
||||
<b>Exception safety:</b> Strong.<br>
|
||||
<b>Exception safety:</b> Strong, except that rehashing may occur even if the operation fails.<br>
|
||||
</blockquote>
|
||||
|
||||
<code>iterator insert(iterator position,const value_type& x);</code><br>
|
||||
@ -583,7 +604,7 @@ element. Otherwise, an iterator to an element that caused the insertion to be
|
||||
banned. Note that more than one element can be causing insertion not to be
|
||||
allowed.<br>
|
||||
<b>Complexity:</b> <code>O(H(n))</code>.<br>
|
||||
<b>Exception safety:</b> Strong.<br>
|
||||
<b>Exception safety:</b> Strong, except that rehashing may occur even if the operation fails.<br>
|
||||
</blockquote>
|
||||
|
||||
<code>template<typename InputIterator><br>
|
||||
@ -618,7 +639,7 @@ to which this index belongs if
|
||||
<blockquote>
|
||||
<b>Effects:</b>
|
||||
<blockquote><pre>
|
||||
<span class=identifier>insert</span><span class=special>(</span><span class=identifier>list</span><span class=special>.</span><span class=identifier>begin</span><span class=special>(),</span><span class=identifier>list</span><span class=special>.</span><span class=identifier>end</span><span class=special>())</span>
|
||||
<span class=identifier>insert</span><span class=special>(</span><span class=identifier>list</span><span class=special>.</span><span class=identifier>begin</span><span class=special>(),</span><span class=identifier>list</span><span class=special>.</span><span class=identifier>end</span><span class=special>())</span><span class=special>;</span>
|
||||
</pre></blockquote>
|
||||
</blockquote>
|
||||
|
||||
@ -641,7 +662,7 @@ if no such element exists.<br>
|
||||
<b>Effects:</b> Deletes the elements with key equivalent to <code>x</code>.<br>
|
||||
<b>Returns:</b> Number of elements deleted.<br>
|
||||
<b>Complexity:</b> Average case, <code>O(1 + m*D(n))</code>, worst case
|
||||
<code>O(n + m*D(n))</code>, where <code>m</code> is
|
||||
<code>O(n<sub>dist</sub> + m*D(n))</code>, where <code>m</code> is
|
||||
the number of elements deleted.<br>
|
||||
<b>Exception safety:</b> Basic.<br>
|
||||
</blockquote>
|
||||
@ -870,7 +891,7 @@ In the context of a compatible extension or a compatible key, the expression
|
||||
<b>Effects:</b> Returns a pointer to an element whose key is equivalent to
|
||||
<code>x</code>, or <code>end()</code> if such an element does not exist.<br>
|
||||
<b>Complexity:</b> Average case <code>O(1)</code> (constant), worst case
|
||||
<code>O(n)</code>.<br>
|
||||
<code>O(n<sub>dist</sub>)</code>.<br>
|
||||
</blockquote>
|
||||
|
||||
<code>template<<br>
|
||||
@ -888,7 +909,7 @@ iterator find(<br>
|
||||
<b>Effects:</b> Returns a pointer to an element whose key is equivalent to
|
||||
<code>x</code>, or <code>end()</code> if such an element does not exist.<br>
|
||||
<b>Complexity:</b> Average case <code>O(1)</code> (constant), worst case
|
||||
<code>O(n)</code>.<br>
|
||||
<code>O(n<sub>dist</sub>)</code>.<br>
|
||||
</blockquote>
|
||||
|
||||
<code>template<typename CompatibleKey><br>
|
||||
@ -900,7 +921,7 @@ size_type count(const CompatibleKey& x)const;
|
||||
(<code>hasher</code>, <code>key_equal</code>).<br>
|
||||
<b>Effects:</b> Returns the number of elements with key equivalent to <code>x</code>.<br>
|
||||
<b>Complexity:</b> Average case <code>O(count(x))</code>, worst case
|
||||
<code>O(n)</code>.<br>
|
||||
<code>O(count(x)+n<sub>dist</sub>)</code>.<br>
|
||||
</blockquote>
|
||||
|
||||
<code>template<<br>
|
||||
@ -917,7 +938,7 @@ size_type count(<br>
|
||||
(<code>hasher</code>, <code>key_equal</code>).<br>
|
||||
<b>Effects:</b> Returns the number of elements with key equivalent to <code>x</code>.<br>
|
||||
<b>Complexity:</b> Average case <code>O(count(x,hash,eq))</code>, worst case
|
||||
<code>O(n)</code>.<br>
|
||||
<code>O(count(x,hash,eq)+n<sub>dist</sub>)</code>.<br>
|
||||
</blockquote>
|
||||
|
||||
<code>template<typename CompatibleKey><br>
|
||||
@ -930,8 +951,8 @@ std::pair<iterator,iterator> equal_range(const CompatibleKey& x)const;
|
||||
<b>Effects:</b> Returns a range containing all elements with keys equivalent
|
||||
to <code>x</code> (and only those), or (<code>end()</code>,<code>end()</code>)
|
||||
if no such elements exist.<br>
|
||||
<b>Complexity:</b> Average case <code>O(count(x))</code>, worst case
|
||||
<code>O(n)</code>.<br>
|
||||
<b>Complexity:</b> Average case <code>O(1)</code> (constant), worst case
|
||||
<code>O(n<sub>dist</sub>)</code>.<br>
|
||||
</blockquote>
|
||||
|
||||
<code>template<<br>
|
||||
@ -949,8 +970,8 @@ std::pair<iterator,iterator> equal_range(<br>
|
||||
<b>Effects:</b> Returns a range containing all elements with keys equivalent
|
||||
to <code>x</code> (and only those), or (<code>end()</code>,<code>end()</code>)
|
||||
if no such elements exist.<br>
|
||||
<b>Complexity:</b> Average case <code>O(count(x,hash,eq))</code>, worst case
|
||||
<code>O(n)</code>.<br>
|
||||
<b>Complexity:</b> Average case <code>O(1)</code> (constant), worst case
|
||||
<code>O(n<sub>dist</sub>)</code>.<br>
|
||||
</blockquote>
|
||||
|
||||
<h4><a name="bucket_interface">Bucket interface</a></h4>
|
||||
@ -976,11 +997,50 @@ so that <code>size()/bucket_count()</code> does not exceed the maximum
|
||||
load factor, and <code>bucket_count()>=n</code>.<br>
|
||||
<b>Postconditions:</b> Validity of iterators and references to the
|
||||
elements contained is preserved.<br>
|
||||
<b>Complexity:</b> Average case <code>O(size())</code>, worst case
|
||||
<code>O(size(n)<sup>2</sup>)</code>.<br>
|
||||
<b>Complexity:</b> <code>O(m)</code>, where <code>m</code> is the number of
|
||||
non-equivalent elements in the index.<br>
|
||||
<b>Exception safety:</b> Strong.
|
||||
</blockquote>
|
||||
|
||||
<code>void reserve(size_type n);</code>
|
||||
|
||||
<blockquote>
|
||||
<b>Effects:</b>
|
||||
<blockquote><pre>
|
||||
<span class=identifier>rehash</span><span class=special>(</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>ceil</span><span class=special>(</span><span class=identifier>n</span><span class=special>/</span><span class=identifier>max_load_factor</span><span class=special>()));</span>
|
||||
</pre></blockquote>
|
||||
</blockquote>
|
||||
|
||||
<h4><a name="comparison">Comparison</a></h4>
|
||||
|
||||
<code>template<<i>implementation defined</i>><br>
|
||||
bool operator==(const <i>index class name</i>& x,const <i>index class name</i>& y);</code>
|
||||
|
||||
<blockquote>
|
||||
<b>Requires:</b> <code>x.key_extractor()</code>, <code>x.hash_function()</code> and
|
||||
<code>x.key_eq()</code> have the same behavior as the corresponding objects in <code>y</code>.
|
||||
For any two elements <code>e1</code>, <code>e2</code> in <code>x</code> or <code>y</code>,
|
||||
if <code>e1==e2</code> then their keys are equivalent.<br>
|
||||
<b>Returns:</b> <code>true</code> iff <code>x</code> and <code>y</code> have the same size
|
||||
and for each key <code>k</code> present in <code>x</code> the range
|
||||
<code>x.equal_range(k)</code> is equal (considering the <code>==</code> operator of <code>value_type</code>)
|
||||
to <code>y.equal_range(k)</code> under permutations of the elements.<br>
|
||||
<b>Complexity:</b> Let <code>k<sub>1</sub></code>,...,<code>k<sub>m</sub></code> be the different
|
||||
keys present in <code>x</code>:<br>
|
||||
<ul>
|
||||
<li>If, for each <code>k<sub>i</sub></code>, <code>x.equal_range(k<sub>i</sub>)</code> is arranged
|
||||
in the same order as <code>y.equal_range(k<sub>i</sub>)</code>, average case is
|
||||
<code>O(x.size())</code>, worst case <code>O(x.size()<sup>2</sup>)</code>.
|
||||
</li>
|
||||
<li>Otherwise, average case is
|
||||
<code>O(<font style="font-size:1.5em">Σ</font>(x.count(k<sub>i</sub>)<sup>2</sup>))</code>,
|
||||
worst case <code>O(x.size()<sup>2</sup>)</code>.
|
||||
</li>
|
||||
</ul>
|
||||
(For unique indices, the formulas above reduce to average case
|
||||
<code>O(x.size())</code>, worst case <code>O(x.size()<sup>2</sup>)</code>.)
|
||||
</blockquote>
|
||||
|
||||
<h4><a name="serialization">Serialization</a></h4>
|
||||
|
||||
<p>
|
||||
@ -1069,7 +1129,7 @@ Sequenced indices
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised July 6th 2013</p>
|
||||
<p>Revised November 30th 2013</p>
|
||||
|
||||
<p>© Copyright 2003-2013 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
|
@ -119,7 +119,7 @@ synopsis</a>
|
||||
<span class=keyword>typename</span> <span class=identifier>nth_index</span><span class=special><</span>
|
||||
<span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>,</span><span class=identifier>N</span>
|
||||
<span class=special>>::</span><span class=identifier>type</span><span class=special>&</span>
|
||||
<span class=identifier>get</span><span class=special>(</span><span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=identifier>m</span><span class=special>);</span>
|
||||
<span class=identifier>get</span><span class=special>(</span><span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=identifier>m</span><span class=special>)</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=keyword>template</span><span class=special><</span>
|
||||
<span class=keyword>int</span> <span class=identifier>N</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Value</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Allocator</span>
|
||||
@ -127,7 +127,7 @@ synopsis</a>
|
||||
<span class=keyword>const</span> <span class=keyword>typename</span> <span class=identifier>nth_index</span><span class=special><</span>
|
||||
<span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>,</span><span class=identifier>N</span>
|
||||
<span class=special>>::</span><span class=identifier>type</span><span class=special>&</span>
|
||||
<span class=identifier>get</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=identifier>m</span><span class=special>);</span>
|
||||
<span class=identifier>get</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=identifier>m</span><span class=special>)</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=keyword>template</span><span class=special><</span>
|
||||
<span class=keyword>typename</span> <span class=identifier>Tag</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Value</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Allocator</span>
|
||||
@ -135,7 +135,7 @@ synopsis</a>
|
||||
<span class=keyword>typename</span> <span class=identifier>index</span><span class=special><</span>
|
||||
<span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>,</span><span class=identifier>Tag</span>
|
||||
<span class=special>>::</span><span class=identifier>type</span><span class=special>&</span>
|
||||
<span class=identifier>get</span><span class=special>(</span><span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=identifier>m</span><span class=special>);</span>
|
||||
<span class=identifier>get</span><span class=special>(</span><span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=identifier>m</span><span class=special>)</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=keyword>template</span><span class=special><</span>
|
||||
<span class=keyword>typename</span> <span class=identifier>Tag</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Value</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Allocator</span>
|
||||
@ -143,7 +143,7 @@ synopsis</a>
|
||||
<span class=keyword>const</span> <span class=keyword>typename</span> <span class=identifier>index</span><span class=special><</span>
|
||||
<span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>,</span><span class=identifier>Tag</span>
|
||||
<span class=special>>::</span><span class=identifier>type</span><span class=special>&</span>
|
||||
<span class=identifier>get</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=identifier>m</span><span class=special>);</span>
|
||||
<span class=identifier>get</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=identifier>m</span><span class=special>)</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// multi_index_container global functions for projection of iterators:</span>
|
||||
|
||||
@ -314,14 +314,14 @@ operators and functions associated with the index (vg. comparison and
|
||||
<span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=keyword>operator</span><span class=special>=(</span>
|
||||
<span class=identifier>std</span><span class=special>::</span><span class=identifier>initializer_list</span><span class=special><</span><span class=identifier>Value</span><span class=special>></span> <span class=identifier>list</span><span class=special>)</span>
|
||||
|
||||
<span class=identifier>allocator_type</span> <span class=identifier>get_allocator</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>allocator_type</span> <span class=identifier>get_allocator</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// retrieval of indices</span>
|
||||
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>int</span> <span class=identifier>N</span><span class=special>></span> <span class=keyword>typename</span> <span class=identifier>nth_index</span><span class=special><</span><span class=identifier>N</span><span class=special>>::</span><span class=identifier>type</span><span class=special>&</span> <span class=identifier>get</span><span class=special>();</span>
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>int</span> <span class=identifier>N</span><span class=special>></span> <span class=keyword>const</span> <span class=keyword>typename</span> <span class=identifier>nth_index</span><span class=special><</span><span class=identifier>N</span><span class=special>>::</span><span class=identifier>type</span><span class=special>&</span> <span class=identifier>get</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>typename</span> <span class=identifier>Tag</span><span class=special>></span> <span class=keyword>typename</span> <span class=identifier>index</span><span class=special><</span><span class=identifier>Tag</span><span class=special>>::</span><span class=identifier>type</span><span class=special>&</span> <span class=identifier>get</span><span class=special>()</span>
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>typename</span> <span class=identifier>Tag</span><span class=special>></span> <span class=keyword>const</span> <span class=keyword>typename</span> <span class=identifier>index</span><span class=special><</span><span class=identifier>Tag</span><span class=special>>::</span><span class=identifier>type</span><span class=special>&</span> <span class=identifier>get</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>int</span> <span class=identifier>N</span><span class=special>></span> <span class=keyword>typename</span> <span class=identifier>nth_index</span><span class=special><</span><span class=identifier>N</span><span class=special>>::</span><span class=identifier>type</span><span class=special>&</span> <span class=identifier>get</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>int</span> <span class=identifier>N</span><span class=special>></span> <span class=keyword>const</span> <span class=keyword>typename</span> <span class=identifier>nth_index</span><span class=special><</span><span class=identifier>N</span><span class=special>>::</span><span class=identifier>type</span><span class=special>&</span> <span class=identifier>get</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>typename</span> <span class=identifier>Tag</span><span class=special>></span> <span class=keyword>typename</span> <span class=identifier>index</span><span class=special><</span><span class=identifier>Tag</span><span class=special>>::</span><span class=identifier>type</span><span class=special>&</span> <span class=identifier>get</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>typename</span> <span class=identifier>Tag</span><span class=special>></span> <span class=keyword>const</span> <span class=keyword>typename</span> <span class=identifier>index</span><span class=special><</span><span class=identifier>Tag</span><span class=special>>::</span><span class=identifier>type</span><span class=special>&</span> <span class=identifier>get</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// projection of iterators</span>
|
||||
|
||||
@ -379,7 +379,7 @@ operators and functions associated with the index (vg. comparison and
|
||||
<span class=keyword>typename</span> <span class=identifier>nth_index</span><span class=special><</span>
|
||||
<span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>,</span><span class=identifier>N</span>
|
||||
<span class=special>>::</span><span class=identifier>type</span><span class=special>&</span>
|
||||
<span class=identifier>get</span><span class=special>(</span><span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=identifier>m</span><span class=special>)</span>
|
||||
<span class=identifier>get</span><span class=special>(</span><span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=identifier>m</span><span class=special>)</span><span class=keyword>noexcept</span>
|
||||
<span class=special>{</span>
|
||||
<span class=keyword>return</span> <span class=identifier>m</span><span class=special>.</span><span class=identifier>get</span><span class=special><</span><span class=identifier>N</span><span class=special>>();</span>
|
||||
<span class=special>}</span>
|
||||
@ -390,7 +390,7 @@ operators and functions associated with the index (vg. comparison and
|
||||
<span class=keyword>const</span> <span class=keyword>typename</span> <span class=identifier>nth_index</span><span class=special><</span>
|
||||
<span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>,</span><span class=identifier>N</span>
|
||||
<span class=special>>::</span><span class=identifier>type</span><span class=special>&</span>
|
||||
<span class=identifier>get</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=identifier>m</span><span class=special>)</span>
|
||||
<span class=identifier>get</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=identifier>m</span><span class=special>)</span><span class=keyword>noexcept</span>
|
||||
<span class=special>{</span>
|
||||
<span class=keyword>return</span> <span class=identifier>m</span><span class=special>.</span><span class=identifier>get</span><span class=special><</span><span class=identifier>N</span><span class=special>>();</span>
|
||||
<span class=special>}</span>
|
||||
@ -401,7 +401,7 @@ operators and functions associated with the index (vg. comparison and
|
||||
<span class=keyword>typename</span> <span class=identifier>index</span><span class=special><</span>
|
||||
<span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>,</span><span class=identifier>Tag</span>
|
||||
<span class=special>>::</span><span class=identifier>type</span><span class=special>&</span>
|
||||
<span class=identifier>get</span><span class=special>(</span><span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=identifier>m</span><span class=special>)</span>
|
||||
<span class=identifier>get</span><span class=special>(</span><span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=identifier>m</span><span class=special>)</span><span class=keyword>noexcept</span>
|
||||
<span class=special>{</span>
|
||||
<span class=keyword>return</span> <span class=identifier>m</span><span class=special>.</span><span class=identifier>get</span><span class=special><</span><span class=identifier>Tag</span><span class=special>>();</span>
|
||||
<span class=special>}</span>
|
||||
@ -412,7 +412,7 @@ operators and functions associated with the index (vg. comparison and
|
||||
<span class=keyword>const</span> <span class=keyword>typename</span> <span class=identifier>index</span><span class=special><</span>
|
||||
<span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>,</span><span class=identifier>Tag</span>
|
||||
<span class=special>>::</span><span class=identifier>type</span><span class=special>&</span>
|
||||
<span class=identifier>get</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=identifier>m</span><span class=special>)</span>
|
||||
<span class=identifier>get</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>multi_index_container</span><span class=special><</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>>&</span> <span class=identifier>m</span><span class=special>)</span><span class=keyword>noexcept</span>
|
||||
<span class=special>{</span>
|
||||
<span class=keyword>return</span> <span class=identifier>m</span><span class=special>.</span><span class=identifier>get</span><span class=special><</span><span class=identifier>Tag</span><span class=special>>();</span>
|
||||
<span class=special>}</span>
|
||||
@ -537,7 +537,7 @@ scheme outlined in the
|
||||
<ul>
|
||||
<li>Non-equal allocator instances are supported: swapping two non-equal
|
||||
instances must not throw any exception.
|
||||
</li>s
|
||||
</li>
|
||||
<li>For every type <code>T</code>,
|
||||
the type <code>Allocator::rebind<T>::other::pointer</code> can be any
|
||||
kind of random access iterator, provided that it is explicitly constructible from
|
||||
@ -804,7 +804,7 @@ number of elements of <code>list</code>.<br>
|
||||
of the types of <code>ctor_args_list</code> do not throw.
|
||||
</blockquote>
|
||||
|
||||
<code>allocator_type get_allocator()const;</code>
|
||||
<code>allocator_type get_allocator()const noexcept;</code>
|
||||
|
||||
<blockquote>
|
||||
Returns a copy of the <code>allocator_type</code> object used to construct
|
||||
@ -814,27 +814,25 @@ the <code>multi_index_container</code>.<br>
|
||||
|
||||
<h4><a name="index_retrieval">Index retrieval operations</a></h4>
|
||||
|
||||
<code>template<int N> typename nth_index<N>::type& get();</code>
|
||||
<code>template<int N> typename nth_index<N>::type& get()noexcept;</code>
|
||||
|
||||
<blockquote>
|
||||
<b>Requires:</b> <code>0 <= N < I</code>.<br>
|
||||
<b>Effects:</b> Returns a reference to the
|
||||
<code>nth_index<N>::type</code> index held by <code>*this</code>.<br>
|
||||
<b>Complexity:</b> Constant.<br>
|
||||
<b>Exception safety:</b> <code>nothrow</code>.
|
||||
</blockquote>
|
||||
|
||||
<code>template<int N> const typename nth_index<N>::type& get()const;</code>
|
||||
<code>template<int N> const typename nth_index<N>::type& get()const noexcept;</code>
|
||||
|
||||
<blockquote>
|
||||
<b>Requires:</b> <code>0 <= N < I</code>.<br>
|
||||
<b>Effects:</b> Returns a <code>const</code> reference to the
|
||||
<code>nth_index<N>::type</code> index held by <code>*this</code>.<br>
|
||||
<b>Complexity:</b> Constant.<br>
|
||||
<b>Exception safety:</b> <code>nothrow</code>.
|
||||
</blockquote>
|
||||
|
||||
<code>template<typename Tag> typename index<Tag>::type& get()</code>
|
||||
<code>template<typename Tag> typename index<Tag>::type& get()noexcept;</code>
|
||||
|
||||
<blockquote>
|
||||
<b>Requires:</b> <code>Tag</code> is such that <code>index<Tag>::type</code>
|
||||
@ -843,10 +841,9 @@ is valid.<br>
|
||||
<code>index<Tag>::type</code> index held by
|
||||
<code>*this</code>.<br>
|
||||
<b>Complexity:</b> Constant.<br>
|
||||
<b>Exception safety:</b> <code>nothrow</code>.
|
||||
</blockquote>
|
||||
|
||||
<code>template<typename Tag> const typename index<Tag>::type& get()const;</code>
|
||||
<code>template<typename Tag> const typename index<Tag>::type& get()const noexcept;</code>
|
||||
|
||||
<blockquote>
|
||||
<b>Requires:</b> <code>Tag</code> is such that <code>index<Tag>::type</code>
|
||||
@ -855,7 +852,6 @@ is valid.<br>
|
||||
<code>index<Tag>::type</code> index held by
|
||||
<code>*this</code>.<br>
|
||||
<b>Complexity:</b> Constant.<br>
|
||||
<b>Exception safety:</b> <code>nothrow</code>.
|
||||
</blockquote>
|
||||
|
||||
<h4><a name="projection">Projection operations</a></h4>
|
||||
@ -996,7 +992,7 @@ Index reference
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised July 3rd 2013</p>
|
||||
<p>Revised October 12th 2013</p>
|
||||
|
||||
<p>© Copyright 2003-2013 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
|
@ -243,31 +243,31 @@ do not exactly conform to or are not mandated by the standard requirements.
|
||||
<b>index class name</b><span class=special>&</span> <span class=keyword>operator</span><span class=special>=(</span><span class=keyword>const</span> <b>index class name</b><span class=special>&</span> <span class=identifier>x</span><span class=special>);</span>
|
||||
<b>index class name</b><span class=special>&</span> <span class=keyword>operator</span><span class=special>=(</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>initializer_list</span><span class=special><</span><span class=identifier>value_type</span><span class=special>></span> <span class=identifier>list</span><span class=special>);</span>
|
||||
|
||||
<span class=identifier>allocator_type</span> <span class=identifier>get_allocator</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>allocator_type</span> <span class=identifier>get_allocator</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// iterators:</span>
|
||||
|
||||
<span class=identifier>iterator</span> <span class=identifier>begin</span><span class=special>();</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>begin</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>iterator</span> <span class=identifier>end</span><span class=special>();</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>end</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>reverse_iterator</span> <span class=identifier>rbegin</span><span class=special>();</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>rbegin</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>reverse_iterator</span> <span class=identifier>rend</span><span class=special>();</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>rend</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>cbegin</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>cend</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>crbegin</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>crend</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>iterator</span> <span class=identifier>begin</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>begin</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>iterator</span> <span class=identifier>end</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>end</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>reverse_iterator</span> <span class=identifier>rbegin</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>rbegin</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>reverse_iterator</span> <span class=identifier>rend</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>rend</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>cbegin</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>cend</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>crbegin</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>crend</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=identifier>iterator</span> <span class=identifier>iterator_to</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>value_type</span><span class=special>&</span> <span class=identifier>x</span><span class=special>);</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>iterator_to</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>value_type</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// capacity:</span>
|
||||
|
||||
<span class=keyword>bool</span> <span class=identifier>empty</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>size</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>max_size</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=keyword>bool</span> <span class=identifier>empty</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>size</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>max_size</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// modifiers:</span>
|
||||
|
||||
@ -297,7 +297,7 @@ do not exactly conform to or are not mandated by the standard requirements.
|
||||
<span class=keyword>bool</span> <span class=identifier>modify_key</span><span class=special>(</span><span class=identifier>iterator</span> <span class=identifier>position</span><span class=special>,</span><span class=identifier>Modifier</span> <span class=identifier>mod</span><span class=special>,</span><span class=identifier>Rollback</span> <span class=identifier>back</span><span class=special>);</span>
|
||||
|
||||
<span class=keyword>void</span> <span class=identifier>swap</span><span class=special>(</span><b>index class name</b><span class=special>&</span> <span class=identifier>x</span><span class=special>);</span>
|
||||
<span class=keyword>void</span> <span class=identifier>clear</span><span class=special>();</span>
|
||||
<span class=keyword>void</span> <span class=identifier>clear</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// observers:</span>
|
||||
|
||||
@ -631,7 +631,7 @@ to which this index belongs if
|
||||
<blockquote>
|
||||
<b>Effects:</b>
|
||||
<blockquote><pre>
|
||||
<span class=identifier>insert</span><span class=special>(</span><span class=identifier>list</span><span class=special>.</span><span class=identifier>begin</span><span class=special>(),</span><span class=identifier>list</span><span class=special>.</span><span class=identifier>end</span><span class=special>())</span>
|
||||
<span class=identifier>insert</span><span class=special>(</span><span class=identifier>list</span><span class=special>.</span><span class=identifier>begin</span><span class=special>(),</span><span class=identifier>list</span><span class=special>.</span><span class=identifier>end</span><span class=special>())</span><span class=special>;</span>
|
||||
</pre></blockquote>
|
||||
</blockquote>
|
||||
|
||||
@ -1103,7 +1103,7 @@ Hashed indices
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised July 6th 2013</p>
|
||||
<p>Revised October 12th 2013</p>
|
||||
|
||||
<p>© Copyright 2003-2013 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
|
@ -230,32 +230,32 @@ plus the requirements for <code>std::list</code> specific list operations at
|
||||
<span class=keyword>void</span> <span class=identifier>assign</span><span class=special>(</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>initializer_list</span><span class=special><</span><span class=identifier>value_type</span><span class=special>></span> <span class=identifier>list</span><span class=special>)</span>
|
||||
<span class=keyword>void</span> <span class=identifier>assign</span><span class=special>(</span><span class=identifier>size_type</span> <span class=identifier>n</span><span class=special>,</span><span class=keyword>const</span> <span class=identifier>value_type</span><span class=special>&</span> <span class=identifier>value</span><span class=special>);</span>
|
||||
|
||||
<span class=identifier>allocator_type</span> <span class=identifier>get_allocator</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>allocator_type</span> <span class=identifier>get_allocator</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// iterators:</span>
|
||||
|
||||
<span class=identifier>iterator</span> <span class=identifier>begin</span><span class=special>();</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>begin</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>iterator</span> <span class=identifier>end</span><span class=special>();</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>end</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>reverse_iterator</span> <span class=identifier>rbegin</span><span class=special>();</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>rbegin</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>reverse_iterator</span> <span class=identifier>rend</span><span class=special>();</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>rend</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>cbegin</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>cend</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>crbegin</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>crend</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>iterator</span> <span class=identifier>begin</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>begin</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>iterator</span> <span class=identifier>end</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>end</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>reverse_iterator</span> <span class=identifier>rbegin</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>rbegin</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>reverse_iterator</span> <span class=identifier>rend</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>rend</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>cbegin</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>cend</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>crbegin</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>crend</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=identifier>iterator</span> <span class=identifier>iterator_to</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>value_type</span><span class=special>&</span> <span class=identifier>x</span><span class=special>);</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>iterator_to</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>value_type</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// capacity:</span>
|
||||
|
||||
<span class=keyword>bool</span> <span class=identifier>empty</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>size</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>max_size</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>capacity</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=keyword>bool</span> <span class=identifier>empty</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>size</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>max_size</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>capacity</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=keyword>void</span> <span class=identifier>reserve</span><span class=special>(</span><span class=identifier>size_type</span> <span class=identifier>m</span><span class=special>);</span>
|
||||
<span class=keyword>void</span> <span class=identifier>shrink_to_fit</span><span class=special>();</span>
|
||||
|
||||
@ -303,7 +303,7 @@ plus the requirements for <code>std::list</code> specific list operations at
|
||||
|
||||
<span class=keyword>void</span> <span class=identifier>swap</span><span class=special>(</span><b>index class name</b><span class=special>&</span> <span class=identifier>x</span><span class=special>);</span>
|
||||
|
||||
<span class=keyword>void</span> <span class=identifier>clear</span><span class=special>();</span>
|
||||
<span class=keyword>void</span> <span class=identifier>clear</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// list operations:</span>
|
||||
|
||||
@ -325,7 +325,7 @@ plus the requirements for <code>std::list</code> specific list operations at
|
||||
<span class=keyword>void</span> <span class=identifier>sort</span><span class=special>();</span>
|
||||
<span class=keyword>template</span> <span class=special><</span><span class=keyword>typename</span> <span class=identifier>Compare</span><span class=special>></span> <span class=keyword>void</span> <span class=identifier>sort</span><span class=special>(</span><span class=identifier>Compare</span> <span class=identifier>comp</span><span class=special>);</span>
|
||||
|
||||
<span class=keyword>void</span> <span class=identifier>reverse</span><span class=special>();</span>
|
||||
<span class=keyword>void</span> <span class=identifier>reverse</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// rearrange operations:</span>
|
||||
|
||||
@ -517,7 +517,7 @@ const_iterator iterator_to(const value_type& x)const;</code>
|
||||
|
||||
<h4><a name="capacity">Capacity operations</a></h4>
|
||||
|
||||
<a name="capacity_memfun"><code>size_type capacity()const;</code></a>
|
||||
<a name="capacity_memfun"><code>size_type capacity()const noexcept;</code></a>
|
||||
|
||||
<blockquote>
|
||||
<b>Returns:</b> The total number of elements <code>c</code> such that, when
|
||||
@ -987,13 +987,12 @@ is stable, i.e. equivalent elements preserve their relative position.<br>
|
||||
<b>Exception safety:</b> Basic.
|
||||
</blockquote>
|
||||
|
||||
<code>void reverse();</code>
|
||||
<code>void reverse()noexcept;</code>
|
||||
|
||||
<blockquote>
|
||||
<b>Effects:</b> Reverses the order of the elements in the index.<br>
|
||||
<b>Postconditions:</b> Validity of iterators and references is preserved.<br>
|
||||
<b>Complexity:</b> <code>O(n)</code>.<br>
|
||||
<b>Exception safety:</b> <code>nothrow</code>.
|
||||
</blockquote>
|
||||
|
||||
<h4><a name="rearrange_operations">Rearrange operations</a></h4>
|
||||
@ -1108,7 +1107,7 @@ Key extraction
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised July 14th 2013</p>
|
||||
<p>Revised October 12th 2013</p>
|
||||
|
||||
<p>© Copyright 2003-2013 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
|
@ -218,31 +218,31 @@ most important differences are:
|
||||
<span class=keyword>void</span> <span class=identifier>assign</span><span class=special>(</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>initializer_list</span><span class=special><</span><span class=identifier>value_type</span><span class=special>></span> <span class=identifier>list</span><span class=special>);</span>
|
||||
<span class=keyword>void</span> <span class=identifier>assign</span><span class=special>(</span><span class=identifier>size_type</span> <span class=identifier>n</span><span class=special>,</span><span class=keyword>const</span> <span class=identifier>value_type</span><span class=special>&</span> <span class=identifier>value</span><span class=special>);</span>
|
||||
|
||||
<span class=identifier>allocator_type</span> <span class=identifier>get_allocator</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>allocator_type</span> <span class=identifier>get_allocator</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// iterators:</span>
|
||||
|
||||
<span class=identifier>iterator</span> <span class=identifier>begin</span><span class=special>();</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>begin</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>iterator</span> <span class=identifier>end</span><span class=special>();</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>end</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>reverse_iterator</span> <span class=identifier>rbegin</span><span class=special>();</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>rbegin</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>reverse_iterator</span> <span class=identifier>rend</span><span class=special>();</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>rend</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>cbegin</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>cend</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>crbegin</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>crend</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>iterator</span> <span class=identifier>begin</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>begin</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>iterator</span> <span class=identifier>end</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>end</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>reverse_iterator</span> <span class=identifier>rbegin</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>rbegin</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>reverse_iterator</span> <span class=identifier>rend</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>rend</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>cbegin</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>cend</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>crbegin</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>const_reverse_iterator</span> <span class=identifier>crend</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=identifier>iterator</span> <span class=identifier>iterator_to</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>value_type</span><span class=special>&</span> <span class=identifier>x</span><span class=special>);</span>
|
||||
<span class=identifier>const_iterator</span> <span class=identifier>iterator_to</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>value_type</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// capacity:</span>
|
||||
|
||||
<span class=keyword>bool</span> <span class=identifier>empty</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>size</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>max_size</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=keyword>bool</span> <span class=identifier>empty</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>size</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
<span class=identifier>size_type</span> <span class=identifier>max_size</span><span class=special>()</span><span class=keyword>const</span> <span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=keyword>void</span> <span class=identifier>resize</span><span class=special>(</span><span class=identifier>size_type</span> <span class=identifier>n</span><span class=special>);</span>
|
||||
<span class=keyword>void</span> <span class=identifier>resize</span><span class=special>(</span><span class=identifier>size_type</span> <span class=identifier>n</span><span class=special>,</span><span class=keyword>const</span> <span class=identifier>value_type</span><span class=special>&</span> <span class=identifier>x</span><span class=special>);</span>
|
||||
@ -286,7 +286,7 @@ most important differences are:
|
||||
|
||||
<span class=keyword>void</span> <span class=identifier>swap</span><span class=special>(</span><b>index class name</b><span class=special>&</span> <span class=identifier>x</span><span class=special>);</span>
|
||||
|
||||
<span class=keyword>void</span> <span class=identifier>clear</span><span class=special>();</span>
|
||||
<span class=keyword>void</span> <span class=identifier>clear</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// list operations:</span>
|
||||
|
||||
@ -308,7 +308,7 @@ most important differences are:
|
||||
<span class=keyword>void</span> <span class=identifier>sort</span><span class=special>();</span>
|
||||
<span class=keyword>template</span> <span class=special><</span><span class=keyword>typename</span> <span class=identifier>Compare</span><span class=special>></span> <span class=keyword>void</span> <span class=identifier>sort</span><span class=special>(</span><span class=identifier>Compare</span> <span class=identifier>comp</span><span class=special>);</span>
|
||||
|
||||
<span class=keyword>void</span> <span class=identifier>reverse</span><span class=special>();</span>
|
||||
<span class=keyword>void</span> <span class=identifier>reverse</span><span class=special>()</span><span class=keyword>noexcept</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// rearrange operations:</span>
|
||||
|
||||
@ -922,13 +922,12 @@ is stable, i.e. equivalent elements preserve their relative position.<br>
|
||||
not throw; otherwise, basic.
|
||||
</blockquote>
|
||||
|
||||
<code>void reverse();</code>
|
||||
<code>void reverse()noexcept;</code>
|
||||
|
||||
<blockquote>
|
||||
<b>Effects:</b> Reverses the order of the elements in the index.<br>
|
||||
<b>Postconditions:</b> Validity of iterators and references is preserved.<br>
|
||||
<b>Complexity:</b> <code>O(n)</code>.<br>
|
||||
<b>Exception safety:</b> <code>nothrow</code>.
|
||||
</blockquote>
|
||||
|
||||
<h4><a name="rearrange_operations">Rearrange operations</a></h4>
|
||||
@ -1043,7 +1042,7 @@ Random access indices
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised July 8th 2013</p>
|
||||
<p>Revised October 12th 2013</p>
|
||||
|
||||
<p>© Copyright 2003-2013 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
|
@ -30,6 +30,7 @@ Acknowledgements
|
||||
<h2>Contents</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="#boost_1_56">Boost 1.56 release</a></li>
|
||||
<li><a href="#boost_1_55">Boost 1.55 release</a></li>
|
||||
<li><a href="#boost_1_54">Boost 1.54 release</a></li>
|
||||
<li><a href="#boost_1_49">Boost 1.49 release</a></li>
|
||||
@ -48,6 +49,45 @@ Acknowledgements
|
||||
<li><a href="#boost_1_33">Boost 1.33 release</a></li>
|
||||
</ul>
|
||||
|
||||
<h2><a name="boost_1_56">Boost 1.56 release</a></h2>
|
||||
|
||||
<p>
|
||||
<ul>
|
||||
<li>The <code>erase(iterator)</code> member function of hashed indices
|
||||
used to have poor performance under low load conditions due to the requirement
|
||||
that an iterator to the next element must be returned (see ticket
|
||||
<a href="https://svn.boost.org/trac/boost/ticket/4264">#4264</a>). In accordance with
|
||||
the resolution of <a href="http://lwg.github.io/issues/lwg-closed.html#579">LWG
|
||||
issue #579</a>, this problem has been fixed while maintaining the interface of
|
||||
<code>erase</code>, at the expense of using one more
|
||||
word of memory per element. In fact, C++ complexity requirements on unordered
|
||||
associative containers have been improved for hashed indices so that
|
||||
<ul>
|
||||
<li>deletion of a given element is unconditionally constant-time,</li>
|
||||
<li>worst-case performance is not <code>O(n)</code> but <code>O(n<sub>dist</sub>)</code>,
|
||||
where <code>n<sub>dist</sub></code> is the number of non-equivalent elements in the index.
|
||||
</li>
|
||||
</ul>
|
||||
Due to the fact that hashed indices rely on a new data structure, the internal representation of
|
||||
their iterators and local iterators have changed, which affects serialization: their corresponding
|
||||
serialization <a href="../../serialization/doc/tutorial.html#versioning">class version</a> has been
|
||||
bumped from 0 to 1. Old archives involving hashed index (local) iterators can be loaded
|
||||
by Boost 1.56 version of Boost.MultiIndex, but not the other way around.
|
||||
</li>
|
||||
<li>Hashed indices now provide <code>reserve</code>.</li>
|
||||
<li>Hashed indices can now be checked for equality and inequality following the
|
||||
(suitably adapted) C++ standard specification in <b>[unord.req]</b>.</li>
|
||||
<li>The public interface of Boost.MultiIndex provide <code>noexcept</code> specifications
|
||||
where appropriate (for compliant compilers).
|
||||
</li>
|
||||
<li>Improved performance of failed insertions into a <code>multi_index_container</code>.</li>
|
||||
<li>Much internal code aimed at supporting MSVC++ 7.0 and prior has been removed.
|
||||
Compilation times without this legacy code might be slightly faster.
|
||||
</li>
|
||||
<li>Maintenance fixes.</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<h2><a name="boost_1_55">Boost 1.55 release</a></h2>
|
||||
|
||||
<p>
|
||||
@ -81,6 +121,7 @@ Acknowledgements
|
||||
<li>Maintenance fixes.</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<h2><a name="boost_1_54">Boost 1.54 release</a></h2>
|
||||
|
||||
<p>
|
||||
@ -404,7 +445,7 @@ Acknowledgements
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised July 9st 2013</p>
|
||||
<p>Revised November 30th 2013</p>
|
||||
|
||||
<p>© Copyright 2003-2013 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Boost.MultiIndex basic example.
|
||||
*
|
||||
* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -69,10 +69,7 @@ typedef multi_index_container<
|
||||
> employee_set;
|
||||
|
||||
template<typename Tag,typename MultiIndexContainer>
|
||||
void print_out_by(
|
||||
const MultiIndexContainer& s,
|
||||
Tag* =0 /* fixes a MSVC++ 6.0 bug with implicit template function parms */
|
||||
)
|
||||
void print_out_by(const MultiIndexContainer& s)
|
||||
{
|
||||
/* obtain a reference to the index tagged by Tag */
|
||||
|
||||
|
@ -81,19 +81,9 @@ typedef multi_index_container<
|
||||
file_entry,
|
||||
indexed_by<
|
||||
/* primary index sorted by name (inside the same directory) */
|
||||
ordered_unique<
|
||||
name_key
|
||||
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
,composite_key_result_less<name_key::result_type>
|
||||
#endif
|
||||
>,
|
||||
ordered_unique<name_key>,
|
||||
/* secondary index sorted by size (inside the same directory) */
|
||||
ordered_non_unique<
|
||||
size_key
|
||||
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
,composite_key_result_less<size_key::result_type>
|
||||
#endif
|
||||
>
|
||||
ordered_non_unique<size_key>
|
||||
>
|
||||
> file_system;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2011 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,19 +9,17 @@
|
||||
#ifndef BOOST_MULTI_INDEX_COMPOSITE_KEY_HPP
|
||||
#define BOOST_MULTI_INDEX_COMPOSITE_KEY_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||
#include <boost/functional/hash_fwd.hpp>
|
||||
#include <boost/multi_index/detail/access_specifier.hpp>
|
||||
#include <boost/multi_index/detail/prevent_eti.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <boost/mpl/aux_/nttp_decl.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/control/expr_if.hpp>
|
||||
#include <boost/preprocessor/list/at.hpp>
|
||||
@ -59,12 +57,8 @@
|
||||
*/
|
||||
|
||||
#if !defined(BOOST_MULTI_INDEX_LIMIT_COMPOSITE_KEY_SIZE)
|
||||
#if defined(BOOST_MSVC)&&(BOOST_MSVC<1300)
|
||||
#define BOOST_MULTI_INDEX_LIMIT_COMPOSITE_KEY_SIZE 5
|
||||
#else
|
||||
#define BOOST_MULTI_INDEX_LIMIT_COMPOSITE_KEY_SIZE 10
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* maximum number of key extractors in a composite key */
|
||||
|
||||
@ -114,17 +108,14 @@ namespace detail{
|
||||
|
||||
/* n-th key extractor of a composite key */
|
||||
|
||||
template<typename CompositeKey,BOOST_MPL_AUX_NTTP_DECL(int, N)>
|
||||
template<typename CompositeKey,int N>
|
||||
struct nth_key_from_value
|
||||
{
|
||||
typedef typename CompositeKey::key_extractor_tuple key_extractor_tuple;
|
||||
typedef typename prevent_eti<
|
||||
typedef typename mpl::eval_if_c<
|
||||
N<tuples::length<key_extractor_tuple>::value,
|
||||
tuples::element<N,key_extractor_tuple>,
|
||||
typename mpl::eval_if_c<
|
||||
N<tuples::length<key_extractor_tuple>::value,
|
||||
tuples::element<N,key_extractor_tuple>,
|
||||
mpl::identity<tuples::null_type>
|
||||
>::type
|
||||
mpl::identity<tuples::null_type>
|
||||
>::type type;
|
||||
};
|
||||
|
||||
@ -146,7 +137,7 @@ struct BOOST_PP_CAT(key_,name)<tuples::null_type> \
|
||||
typedef tuples::null_type type; \
|
||||
}; \
|
||||
\
|
||||
template<typename CompositeKey,BOOST_MPL_AUX_NTTP_DECL(int, N)> \
|
||||
template<typename CompositeKey,int N> \
|
||||
struct BOOST_PP_CAT(nth_composite_key_,name) \
|
||||
{ \
|
||||
typedef typename nth_key_from_value<CompositeKey,N>::type key_from_value; \
|
||||
@ -589,16 +580,6 @@ struct composite_key_result
|
||||
|
||||
/* composite_key */
|
||||
|
||||
/* NB. Some overloads of operator() have an extra dummy parameter int=0.
|
||||
* This disambiguator serves several purposes:
|
||||
* - Without it, MSVC++ 6.0 incorrectly regards some overloads as
|
||||
* specializations of a previous member function template.
|
||||
* - MSVC++ 6.0/7.0 seem to incorrectly treat some different memfuns
|
||||
* as if they have the same signature.
|
||||
* - If remove_const is broken due to lack of PTS, int=0 avoids the
|
||||
* declaration of memfuns with identical signature.
|
||||
*/
|
||||
|
||||
template<
|
||||
typename Value,
|
||||
BOOST_MULTI_INDEX_CK_ENUM(BOOST_MULTI_INDEX_CK_TEMPLATE_PARM,KeyFromValue)
|
||||
@ -648,7 +629,7 @@ public:
|
||||
return result_type(*this,x.get());
|
||||
}
|
||||
|
||||
result_type operator()(const reference_wrapper<value_type>& x,int=0)const
|
||||
result_type operator()(const reference_wrapper<value_type>& x)const
|
||||
{
|
||||
return result_type(*this,x.get());
|
||||
}
|
||||
@ -1238,7 +1219,6 @@ public:
|
||||
* for composite_key_results enabling interoperation with tuples of values.
|
||||
*/
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
namespace std{
|
||||
|
||||
template<typename CompositeKey>
|
||||
@ -1278,34 +1258,6 @@ struct hash<boost::multi_index::composite_key_result<CompositeKey> >:
|
||||
};
|
||||
|
||||
} /* namespace boost */
|
||||
#else
|
||||
/* Lacking template partial specialization, std::equal_to, std::less and
|
||||
* std::greater will still work for composite_key_results although without
|
||||
* tuple interoperability. To achieve the same graceful degrading with
|
||||
* boost::hash, we define the appropriate hash_value overload.
|
||||
*/
|
||||
|
||||
namespace boost{
|
||||
|
||||
#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
|
||||
namespace multi_index{
|
||||
#endif
|
||||
|
||||
template<typename CompositeKey>
|
||||
inline std::size_t hash_value(
|
||||
const boost::multi_index::composite_key_result<CompositeKey>& x)
|
||||
{
|
||||
boost::multi_index::composite_key_result_hash<
|
||||
boost::multi_index::composite_key_result<CompositeKey> > h;
|
||||
return h(x);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
|
||||
} /* namespace multi_index */
|
||||
#endif
|
||||
|
||||
} /* namespace boost */
|
||||
#endif
|
||||
|
||||
#undef BOOST_MULTI_INDEX_CK_RESULT_HASH_SUPER
|
||||
#undef BOOST_MULTI_INDEX_CK_RESULT_GREATER_SUPER
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_ACCESS_SPECIFIER_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_ACCESS_SPECIFIER_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -42,8 +42,7 @@
|
||||
* official Sun Studio 12.
|
||||
*/
|
||||
|
||||
#if BOOST_WORKAROUND(__GNUC__, <3)||\
|
||||
BOOST_WORKAROUND(__GNUC__,==3)&&(__GNUC_MINOR__<4)||\
|
||||
#if BOOST_WORKAROUND(__GNUC__,==3)&&(__GNUC_MINOR__<4)||\
|
||||
BOOST_WORKAROUND(BOOST_MSVC,==1310)||\
|
||||
BOOST_WORKAROUND(BOOST_MSVC,==1400)||\
|
||||
BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x590))
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_ADL_SWAP_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_ADL_SWAP_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_ARCHIVE_CONSTRUCTED_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_ARCHIVE_CONSTRUCTED_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_AUTO_SPACE_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_AUTO_SPACE_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
#include <algorithm>
|
||||
#include <boost/detail/allocator_utilities.hpp>
|
||||
#include <boost/multi_index/detail/adl_swap.hpp>
|
||||
#include <boost/multi_index/detail/prevent_eti.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <memory>
|
||||
|
||||
@ -46,11 +45,8 @@ namespace detail{
|
||||
template<typename T,typename Allocator=std::allocator<T> >
|
||||
struct auto_space:private noncopyable
|
||||
{
|
||||
typedef typename prevent_eti<
|
||||
Allocator,
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,T
|
||||
>::type
|
||||
typedef typename boost::detail::allocator::rebind_to<
|
||||
Allocator,T
|
||||
>::type::pointer pointer;
|
||||
|
||||
explicit auto_space(const Allocator& al=Allocator(),std::size_t n=1):
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_BASE_TYPE_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_BASE_TYPE_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
#include <boost/mpl/size.hpp>
|
||||
#include <boost/multi_index/detail/index_base.hpp>
|
||||
#include <boost/multi_index/detail/is_index_list.hpp>
|
||||
#include <boost/multi_index/detail/msvc_index_specifier.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost{
|
||||
@ -33,17 +32,6 @@ namespace detail{
|
||||
* a index list.
|
||||
*/
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1310)
|
||||
struct index_applier
|
||||
{
|
||||
template<typename IndexSpecifierMeta,typename SuperMeta>
|
||||
struct apply:
|
||||
msvc_index_specifier<IndexSpecifierMeta::type>::
|
||||
template result_index_class<SuperMeta>
|
||||
{
|
||||
};
|
||||
};
|
||||
#else
|
||||
struct index_applier
|
||||
{
|
||||
template<typename IndexSpecifierMeta,typename SuperMeta>
|
||||
@ -54,7 +42,6 @@ struct index_applier
|
||||
BOOST_NESTED_TEMPLATE index_class<SuperMeta>::type type;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
template<int N,typename Value,typename IndexSpecifierList,typename Allocator>
|
||||
struct nth_layer
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_BIDIR_NODE_ITERATOR_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_BIDIR_NODE_ITERATOR_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_BUCKET_ARRAY_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_BUCKET_ARRAY_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -17,8 +17,11 @@
|
||||
#include <algorithm>
|
||||
#include <boost/multi_index/detail/auto_space.hpp>
|
||||
#include <boost/multi_index/detail/hash_index_node.hpp>
|
||||
#include <boost/multi_index/detail/prevent_eti.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/seq/elem.hpp>
|
||||
#include <boost/preprocessor/seq/enum.hpp>
|
||||
#include <boost/preprocessor/seq/size.hpp>
|
||||
#include <cstddef>
|
||||
#include <limits.h>
|
||||
|
||||
@ -36,115 +39,143 @@ namespace detail{
|
||||
|
||||
/* bucket structure for use by hashed indices */
|
||||
|
||||
#define BOOST_MULTI_INDEX_BA_SIZES_32BIT \
|
||||
(53ul)(97ul)(193ul)(389ul)(769ul) \
|
||||
(1543ul)(3079ul)(6151ul)(12289ul)(24593ul) \
|
||||
(49157ul)(98317ul)(196613ul)(393241ul)(786433ul) \
|
||||
(1572869ul)(3145739ul)(6291469ul)(12582917ul)(25165843ul) \
|
||||
(50331653ul)(100663319ul)(201326611ul)(402653189ul)(805306457ul) \
|
||||
(1610612741ul)(3221225473ul)
|
||||
|
||||
#if ((((ULONG_MAX>>16)>>16)>>16)>>15)==0 /* unsigned long less than 64 bits */
|
||||
#define BOOST_MULTI_INDEX_BA_SIZES \
|
||||
BOOST_MULTI_INDEX_BA_SIZES_32BIT \
|
||||
(4294967291ul)
|
||||
#else
|
||||
/* obtained with aid from
|
||||
* http://javaboutique.internet.com/prime_numb/
|
||||
* http://www.rsok.com/~jrm/next_ten_primes.html
|
||||
* and verified with
|
||||
* http://www.alpertron.com.ar/ECM.HTM
|
||||
*/
|
||||
|
||||
#define BOOST_MULTI_INDEX_BA_SIZES \
|
||||
BOOST_MULTI_INDEX_BA_SIZES_32BIT \
|
||||
(6442450939ul)(12884901893ul)(25769803751ul)(51539607551ul) \
|
||||
(103079215111ul)(206158430209ul)(412316860441ul)(824633720831ul) \
|
||||
(1649267441651ul)(3298534883309ul)(6597069766657ul)(13194139533299ul) \
|
||||
(26388279066623ul)(52776558133303ul)(105553116266489ul)(211106232532969ul) \
|
||||
(422212465066001ul)(844424930131963ul)(1688849860263953ul) \
|
||||
(3377699720527861ul)(6755399441055731ul)(13510798882111483ul) \
|
||||
(27021597764222939ul)(54043195528445957ul)(108086391056891903ul) \
|
||||
(216172782113783843ul)(432345564227567621ul)(864691128455135207ul) \
|
||||
(1729382256910270481ul)(3458764513820540933ul)(6917529027641081903ul) \
|
||||
(13835058055282163729ul)(18446744073709551557ul)
|
||||
#endif
|
||||
|
||||
template<bool _=true> /* templatized to have in-header static var defs */
|
||||
class bucket_array_base:private noncopyable
|
||||
{
|
||||
protected:
|
||||
inline static std::size_t next_prime(std::size_t n)
|
||||
static const std::size_t sizes[];
|
||||
|
||||
static std::size_t size_index(std::size_t n)
|
||||
{
|
||||
static const std::size_t prime_list[]={
|
||||
53ul, 97ul, 193ul, 389ul, 769ul,
|
||||
1543ul, 3079ul, 6151ul, 12289ul, 24593ul,
|
||||
49157ul, 98317ul, 196613ul, 393241ul, 786433ul,
|
||||
1572869ul, 3145739ul, 6291469ul, 12582917ul, 25165843ul,
|
||||
50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul,
|
||||
1610612741ul, 3221225473ul,
|
||||
|
||||
#if ((((ULONG_MAX>>16)>>16)>>16)>>15)==0 /* unsigned long less than 64 bits */
|
||||
4294967291ul
|
||||
#else
|
||||
/* obtained with aid from
|
||||
* http://javaboutique.internet.com/prime_numb/
|
||||
* http://www.rsok.com/~jrm/next_ten_primes.html
|
||||
* and verified with
|
||||
* http://www.alpertron.com.ar/ECM.HTM
|
||||
*/
|
||||
|
||||
6442450939ul, 12884901893ul, 25769803751ul, 51539607551ul,
|
||||
103079215111ul, 206158430209ul, 412316860441ul, 824633720831ul,
|
||||
1649267441651ul, 3298534883309ul, 6597069766657ul, 13194139533299ul,
|
||||
26388279066623ul, 52776558133303ul, 105553116266489ul, 211106232532969ul,
|
||||
422212465066001ul, 844424930131963ul, 1688849860263953ul,
|
||||
3377699720527861ul, 6755399441055731ul, 13510798882111483ul,
|
||||
27021597764222939ul, 54043195528445957ul, 108086391056891903ul,
|
||||
216172782113783843ul, 432345564227567621ul, 864691128455135207ul,
|
||||
1729382256910270481ul, 3458764513820540933ul, 6917529027641081903ul,
|
||||
13835058055282163729ul, 18446744073709551557ul
|
||||
#endif
|
||||
|
||||
};
|
||||
static const std::size_t prime_list_size=
|
||||
sizeof(prime_list)/sizeof(prime_list[0]);
|
||||
|
||||
std::size_t const *bound=
|
||||
std::lower_bound(prime_list,prime_list+prime_list_size,n);
|
||||
if(bound==prime_list+prime_list_size)bound--;
|
||||
return *bound;
|
||||
const std::size_t *bound=std::lower_bound(sizes,sizes+sizes_length,n);
|
||||
if(bound==sizes+sizes_length)bound--;
|
||||
return bound-sizes;
|
||||
}
|
||||
|
||||
#define BOOST_MULTI_INDEX_BA_POSITION_CASE(z,n,_) \
|
||||
case n:return hash%BOOST_PP_SEQ_ELEM(n,BOOST_MULTI_INDEX_BA_SIZES);
|
||||
|
||||
static std::size_t position(std::size_t hash,std::size_t size_index_)
|
||||
{
|
||||
/* Accelerate hash%sizes[size_index_] by replacing with a switch on
|
||||
* hash%Ci expressions, each Ci a compile-time constant, which the
|
||||
* compiler can implement without using integer division.
|
||||
*/
|
||||
|
||||
switch(size_index_){
|
||||
default: /* never used */
|
||||
BOOST_PP_REPEAT(
|
||||
BOOST_PP_SEQ_SIZE(BOOST_MULTI_INDEX_BA_SIZES),
|
||||
BOOST_MULTI_INDEX_BA_POSITION_CASE,~)
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
static const std::size_t sizes_length;
|
||||
};
|
||||
|
||||
template<bool _>
|
||||
const std::size_t bucket_array_base<_>::sizes[]={
|
||||
BOOST_PP_SEQ_ENUM(BOOST_MULTI_INDEX_BA_SIZES)
|
||||
};
|
||||
|
||||
template<bool _>
|
||||
const std::size_t bucket_array_base<_>::sizes_length=
|
||||
sizeof(bucket_array_base<_>::sizes)/
|
||||
sizeof(bucket_array_base<_>::sizes[0]);
|
||||
|
||||
#undef BOOST_MULTI_INDEX_BA_POSITION_CASE
|
||||
#undef BOOST_MULTI_INDEX_BA_SIZES
|
||||
#undef BOOST_MULTI_INDEX_BA_SIZES_32BIT
|
||||
|
||||
template<typename Allocator>
|
||||
class bucket_array:public bucket_array_base
|
||||
class bucket_array:bucket_array_base<>
|
||||
{
|
||||
typedef typename prevent_eti<
|
||||
Allocator,
|
||||
hashed_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
char
|
||||
>::type
|
||||
>
|
||||
>::type node_impl_type;
|
||||
typedef bucket_array_base<> super;
|
||||
typedef hashed_index_base_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
char
|
||||
>::type
|
||||
> base_node_impl_type;
|
||||
|
||||
public:
|
||||
typedef typename node_impl_type::pointer pointer;
|
||||
typedef typename base_node_impl_type::base_pointer base_pointer;
|
||||
typedef typename base_node_impl_type::pointer pointer;
|
||||
|
||||
bucket_array(const Allocator& al,pointer end_,std::size_t size):
|
||||
size_(bucket_array_base::next_prime(size)),
|
||||
spc(al,size_+1)
|
||||
bucket_array(const Allocator& al,pointer end_,std::size_t size_):
|
||||
size_index_(super::size_index(size_)),
|
||||
spc(al,super::sizes[size_index_]+1)
|
||||
{
|
||||
clear();
|
||||
end()->next()=end_;
|
||||
end_->next()=end();
|
||||
clear(end_);
|
||||
}
|
||||
|
||||
std::size_t size()const
|
||||
{
|
||||
return size_;
|
||||
return super::sizes[size_index_];
|
||||
}
|
||||
|
||||
std::size_t position(std::size_t hash)const
|
||||
{
|
||||
return hash%size_;
|
||||
return super::position(hash,size_index_);
|
||||
}
|
||||
|
||||
pointer begin()const{return buckets();}
|
||||
pointer end()const{return buckets()+size_;}
|
||||
pointer at(std::size_t n)const{return buckets()+n;}
|
||||
base_pointer begin()const{return buckets();}
|
||||
base_pointer end()const{return buckets()+size();}
|
||||
base_pointer at(std::size_t n)const{return buckets()+n;}
|
||||
|
||||
std::size_t first_nonempty(std::size_t n)const
|
||||
void clear(pointer end_)
|
||||
{
|
||||
for(;;++n){
|
||||
pointer x=at(n);
|
||||
if(x->next()!=x)return n;
|
||||
}
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
for(pointer x=begin(),y=end();x!=y;++x)x->next()=x;
|
||||
}
|
||||
for(base_pointer x=begin(),y=end();x!=y;++x)x->next()=pointer(0);
|
||||
end()->next()=end_->next()=end_;
|
||||
end_->prior()=end();
|
||||
}
|
||||
|
||||
void swap(bucket_array& x)
|
||||
{
|
||||
std::swap(size_,x.size_);
|
||||
std::swap(size_index_,x.size_index_);
|
||||
spc.swap(x.spc);
|
||||
}
|
||||
|
||||
private:
|
||||
std::size_t size_;
|
||||
auto_space<node_impl_type,Allocator> spc;
|
||||
std::size_t size_index_;
|
||||
auto_space<base_node_impl_type,Allocator> spc;
|
||||
|
||||
pointer buckets()const
|
||||
base_pointer buckets()const
|
||||
{
|
||||
return spc.data();
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_CONVERTER_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_CONVERTER_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_COPY_MAP_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_COPY_MAP_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
#include <algorithm>
|
||||
#include <boost/detail/no_exceptions_support.hpp>
|
||||
#include <boost/multi_index/detail/auto_space.hpp>
|
||||
#include <boost/multi_index/detail/prevent_eti.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
@ -110,20 +109,18 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
typedef typename prevent_eti<
|
||||
Allocator,
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,Node>::type
|
||||
>::type allocator_type;
|
||||
typedef typename allocator_type::pointer allocator_pointer;
|
||||
typedef typename boost::detail::allocator::rebind_to<
|
||||
Allocator,Node
|
||||
>::type allocator_type;
|
||||
typedef typename allocator_type::pointer allocator_pointer;
|
||||
|
||||
allocator_type al_;
|
||||
std::size_t size_;
|
||||
auto_space<copy_map_entry<Node>,Allocator> spc;
|
||||
std::size_t n;
|
||||
Node* header_org_;
|
||||
Node* header_cpy_;
|
||||
bool released;
|
||||
allocator_type al_;
|
||||
std::size_t size_;
|
||||
auto_space<copy_map_entry<Node>,Allocator> spc;
|
||||
std::size_t n;
|
||||
Node* header_org_;
|
||||
Node* header_cpy_;
|
||||
bool released;
|
||||
|
||||
void deallocate(Node* node)
|
||||
{
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_DO_NOT_COPY_ELEMENTS_TAG_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_DO_NOT_COPY_ELEMENTS_TAG_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_DUPLICATES_ITERATOR_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_DUPLICATES_ITERATOR_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_HAS_TAG_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_HAS_TAG_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_HASH_INDEX_ARGS_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_HASH_INDEX_ARGS_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_HASH_INDEX_ITERATOR_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_HASH_INDEX_ITERATOR_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include <boost/serialization/split_member.hpp>
|
||||
#include <boost/serialization/version.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
@ -30,10 +31,13 @@ namespace detail{
|
||||
/* Iterator class for hashed indices.
|
||||
*/
|
||||
|
||||
template<typename Node,typename BucketArray>
|
||||
struct hashed_index_global_iterator_tag{};
|
||||
struct hashed_index_local_iterator_tag{};
|
||||
|
||||
template<typename Node,typename BucketArray,typename Category>
|
||||
class hashed_index_iterator:
|
||||
public forward_iterator_helper<
|
||||
hashed_index_iterator<Node,BucketArray>,
|
||||
hashed_index_iterator<Node,BucketArray,Category>,
|
||||
typename Node::value_type,
|
||||
std::ptrdiff_t,
|
||||
const typename Node::value_type*,
|
||||
@ -41,9 +45,7 @@ class hashed_index_iterator:
|
||||
{
|
||||
public:
|
||||
hashed_index_iterator(){}
|
||||
hashed_index_iterator(Node* node_,BucketArray* buckets_):
|
||||
node(node_),buckets(buckets_)
|
||||
{}
|
||||
hashed_index_iterator(Node* node_):node(node_){}
|
||||
|
||||
const typename Node::value_type& operator*()const
|
||||
{
|
||||
@ -52,7 +54,7 @@ public:
|
||||
|
||||
hashed_index_iterator& operator++()
|
||||
{
|
||||
Node::increment(node,buckets->begin(),buckets->end());
|
||||
this->increment(Category());
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -70,16 +72,42 @@ public:
|
||||
{
|
||||
node_base_type* bnode=node;
|
||||
ar<<serialization::make_nvp("pointer",bnode);
|
||||
ar<<serialization::make_nvp("pointer",buckets);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
void load(Archive& ar,const unsigned int)
|
||||
void load(Archive& ar,const unsigned int version)
|
||||
{
|
||||
load(ar,version,Category());
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
void load(
|
||||
Archive& ar,const unsigned int version,hashed_index_global_iterator_tag)
|
||||
{
|
||||
node_base_type* bnode;
|
||||
ar>>serialization::make_nvp("pointer",bnode);
|
||||
node=static_cast<Node*>(bnode);
|
||||
ar>>serialization::make_nvp("pointer",buckets);
|
||||
if(version<1){
|
||||
BucketArray* throw_away; /* consume unused ptr */
|
||||
ar>>serialization::make_nvp("pointer",throw_away);
|
||||
}
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
void load(
|
||||
Archive& ar,const unsigned int version,hashed_index_local_iterator_tag)
|
||||
{
|
||||
node_base_type* bnode;
|
||||
ar>>serialization::make_nvp("pointer",bnode);
|
||||
node=static_cast<Node*>(bnode);
|
||||
if(version<1){
|
||||
BucketArray* buckets;
|
||||
ar>>serialization::make_nvp("pointer",buckets);
|
||||
if(buckets&&node&&node->impl()==buckets->end()->next()->next()){
|
||||
/* end local_iterators used to point to end node, now they are null */
|
||||
node=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -90,14 +118,24 @@ public:
|
||||
Node* get_node()const{return node;}
|
||||
|
||||
private:
|
||||
Node* node;
|
||||
BucketArray* buckets;
|
||||
|
||||
void increment(hashed_index_global_iterator_tag)
|
||||
{
|
||||
Node::increment(node);
|
||||
}
|
||||
|
||||
void increment(hashed_index_local_iterator_tag)
|
||||
{
|
||||
Node::increment_local(node);
|
||||
}
|
||||
|
||||
Node* node;
|
||||
};
|
||||
|
||||
template<typename Node,typename BucketArray>
|
||||
template<typename Node,typename BucketArray,typename Category>
|
||||
bool operator==(
|
||||
const hashed_index_iterator<Node,BucketArray>& x,
|
||||
const hashed_index_iterator<Node,BucketArray>& y)
|
||||
const hashed_index_iterator<Node,BucketArray,Category>& x,
|
||||
const hashed_index_iterator<Node,BucketArray,Category>& y)
|
||||
{
|
||||
return x.get_node()==y.get_node();
|
||||
}
|
||||
@ -106,6 +144,22 @@ bool operator==(
|
||||
|
||||
} /* namespace multi_index */
|
||||
|
||||
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
|
||||
/* class version = 1 : hashed_index_iterator does no longer serialize a bucket
|
||||
* array pointer.
|
||||
*/
|
||||
|
||||
namespace serialization {
|
||||
template<typename Node,typename BucketArray,typename Category>
|
||||
struct version<
|
||||
boost::multi_index::detail::hashed_index_iterator<Node,BucketArray,Category>
|
||||
>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(int,value=1);
|
||||
};
|
||||
} /* namespace serialization */
|
||||
#endif
|
||||
|
||||
} /* namespace boost */
|
||||
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,14 +9,12 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_HASH_INDEX_NODE_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_HASH_INDEX_NODE_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||
#include <boost/detail/allocator_utilities.hpp>
|
||||
#include <boost/multi_index/detail/prevent_eti.hpp>
|
||||
#include <functional>
|
||||
|
||||
namespace boost{
|
||||
|
||||
@ -24,104 +22,632 @@ namespace multi_index{
|
||||
|
||||
namespace detail{
|
||||
|
||||
/* singly-linked node for use by hashed_index */
|
||||
/* Certain C++ requirements on unordered associative containers (see LWG issue
|
||||
* #579) imply a data structure where nodes are linked in a single list, which
|
||||
* in its turn forces implementors to add additional overhed per node to
|
||||
* associate each with its corresponding bucket. Others resort to storing hash
|
||||
* values, we use an alternative structure providing unconditional O(1)
|
||||
* manipulation, even in situations of unfair hash distribution, plus some
|
||||
* lookup speedups. For unique indices we maintain a doubly linked list of
|
||||
* nodes except that the first node N of a bucket is back-linked to its bucket
|
||||
* node, and this bucket node forward links to the node preceding N.
|
||||
*
|
||||
* +---+ +---+ +---+ +---+
|
||||
* | +-->| +--> | +-->| +-->
|
||||
* ... | B0| | B1| ... | B1| | B2| ...
|
||||
* <--+ | +-+ | <--+ | +-+ |
|
||||
* +---+ | +---+ +---+ | +---+
|
||||
* ^ | ^ |
|
||||
* | | | |
|
||||
* +-+ | +-+ |
|
||||
* | | | |
|
||||
* + v + v
|
||||
* --+---+---+---+-- --+---+---+---+--
|
||||
* ... | | B1| | ... | | B2| | ...
|
||||
* --+---+---+---+-- --+---+---+---+--
|
||||
*
|
||||
* The fist and last nodes of buckets can be checked with
|
||||
*
|
||||
* first node of a bucket: Npn != N
|
||||
* last node of a bucket: Nnp != N
|
||||
*
|
||||
* (n and p short for ->next(), ->prior()). Pure insert and erase (without
|
||||
* lookup) can be unconditionally done in O(1).
|
||||
* For non-unique indices we add the following additional complexity: when
|
||||
* there is a group of 3 or more equivalent elements, they are linked as
|
||||
* follows:
|
||||
*
|
||||
* +-----------------------+
|
||||
* v |
|
||||
* +---+ +---+ +---+ | +---+
|
||||
* | +-->| | | +-+ | |
|
||||
* | F | | S | ... | P | | L |
|
||||
* | | +-+ | | |<--+ |
|
||||
* +---+ | +---+ +---+ +---+
|
||||
* | ^
|
||||
* +-----------------------+
|
||||
*
|
||||
* F, S, P and L are the first, second, penultimate and last node in the
|
||||
* group, respectively (S and P can coincide if the group has size 3.) This
|
||||
* arrangement is used to skip equivalent elements in O(1) when doing lookup,
|
||||
* while preserving O(1) insert/erase. The following invariants identify
|
||||
* special positions (some of the operations have to be carefully implemented
|
||||
* as Xpp is not valid if Xp points to a bucket):
|
||||
*
|
||||
* first node of a bucket: Npnn == N
|
||||
* last node of a bucket: Nnpn == N
|
||||
* first node of a group: Nnp != N && Nnppn == N
|
||||
* second node of a group: Npn != N && Nppnn == N
|
||||
* n-1 node of a group: Nnp != N && Nnnpp == N
|
||||
* last node of a group: Npn != N && Npnnp == N
|
||||
*
|
||||
* The memory overhead is one pointer per bucket plus two pointers per node,
|
||||
* probably unbeatable. The resulting structure is bidirectonally traversable,
|
||||
* though currently we are just providing forward iteration.
|
||||
*/
|
||||
|
||||
template<typename Allocator>
|
||||
struct hashed_index_node_impl
|
||||
struct hashed_index_node_impl;
|
||||
|
||||
/* half-header (only next() pointer) to use for the bucket array */
|
||||
|
||||
template<typename Allocator>
|
||||
struct hashed_index_base_node_impl
|
||||
{
|
||||
typedef typename prevent_eti<
|
||||
typedef typename
|
||||
boost::detail::allocator::rebind_to<
|
||||
Allocator,hashed_index_base_node_impl
|
||||
>::type::pointer base_pointer;
|
||||
typedef typename
|
||||
boost::detail::allocator::rebind_to<
|
||||
Allocator,hashed_index_base_node_impl
|
||||
>::type::const_pointer const_base_pointer;
|
||||
typedef typename
|
||||
boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,hashed_index_node_impl
|
||||
>::type
|
||||
>::type::pointer pointer;
|
||||
typedef typename prevent_eti<
|
||||
hashed_index_node_impl<Allocator>
|
||||
>::type::pointer pointer;
|
||||
typedef typename
|
||||
boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,hashed_index_node_impl
|
||||
>::type
|
||||
>::type::const_pointer const_pointer;
|
||||
hashed_index_node_impl<Allocator>
|
||||
>::type::const_pointer const_pointer;
|
||||
|
||||
pointer& next(){return next_;}
|
||||
pointer next()const{return next_;}
|
||||
|
||||
/* algorithmic stuff */
|
||||
|
||||
static void increment(pointer& x,pointer bbegin,pointer bend)
|
||||
{
|
||||
std::less_equal<pointer> leq;
|
||||
|
||||
x=x->next();
|
||||
if(leq(bbegin,x)&&leq(x,bend)){ /* bucket node */
|
||||
do{
|
||||
++x;
|
||||
}while(x->next()==x);
|
||||
x=x->next();
|
||||
}
|
||||
}
|
||||
|
||||
static void link(pointer x,pointer pos)
|
||||
{
|
||||
x->next()=pos->next();
|
||||
pos->next()=x;
|
||||
};
|
||||
|
||||
static void unlink(pointer x)
|
||||
{
|
||||
pointer y=x->next();
|
||||
while(y->next()!=x){y=y->next();}
|
||||
y->next()=x->next();
|
||||
}
|
||||
|
||||
static pointer prev(pointer x)
|
||||
{
|
||||
pointer y=x->next();
|
||||
while(y->next()!=x){y=y->next();}
|
||||
return y;
|
||||
}
|
||||
|
||||
static void unlink_next(pointer x)
|
||||
{
|
||||
x->next()=x->next()->next();
|
||||
}
|
||||
|
||||
private:
|
||||
pointer next_;
|
||||
};
|
||||
|
||||
template<typename Super>
|
||||
struct hashed_index_node_trampoline:
|
||||
prevent_eti<
|
||||
Super,
|
||||
hashed_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
typename Super::allocator_type,
|
||||
char
|
||||
>::type
|
||||
>
|
||||
>::type
|
||||
/* full header (next() and prior()) for the nodes */
|
||||
|
||||
template<typename Allocator>
|
||||
struct hashed_index_node_impl:hashed_index_base_node_impl<Allocator>
|
||||
{
|
||||
typedef typename prevent_eti<
|
||||
Super,
|
||||
hashed_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
typename Super::allocator_type,
|
||||
char
|
||||
>::type
|
||||
>
|
||||
>::type impl_type;
|
||||
private:
|
||||
typedef hashed_index_base_node_impl<Allocator> super;
|
||||
|
||||
public:
|
||||
typedef typename super::base_pointer base_pointer;
|
||||
typedef typename super::const_base_pointer const_base_pointer;
|
||||
typedef typename super::pointer pointer;
|
||||
typedef typename super::const_pointer const_pointer;
|
||||
|
||||
base_pointer& prior(){return prior_;}
|
||||
base_pointer prior()const{return prior_;}
|
||||
|
||||
static pointer pointer_from(base_pointer x)
|
||||
{
|
||||
return static_cast<pointer>(static_cast<hashed_index_node_impl*>(&*x));
|
||||
}
|
||||
|
||||
static base_pointer base_pointer_from(pointer x)
|
||||
{
|
||||
return static_cast<base_pointer>(&*x);
|
||||
}
|
||||
|
||||
private:
|
||||
base_pointer prior_;
|
||||
};
|
||||
|
||||
/* Boost.MultiIndex requires machinery to reverse unlink operations. A simple
|
||||
* way to make a pointer-manipulation function undoable is to templatize
|
||||
* its internal pointer assignments with a functor that, besides doing the
|
||||
* assignment, keeps track of the original pointer values and can later undo
|
||||
* the operations in reverse order.
|
||||
*/
|
||||
|
||||
struct default_assigner
|
||||
{
|
||||
template<typename T> void operator()(T& x,const T& val){x=val;}
|
||||
};
|
||||
|
||||
template<typename Node>
|
||||
struct unlink_undo_assigner
|
||||
{
|
||||
typedef typename Node::base_pointer base_pointer;
|
||||
typedef typename Node::pointer pointer;
|
||||
|
||||
unlink_undo_assigner():pointer_track_count(0),base_pointer_track_count(0){}
|
||||
|
||||
void operator()(pointer& x,pointer val)
|
||||
{
|
||||
pointer_tracks[pointer_track_count].x=&x;
|
||||
pointer_tracks[pointer_track_count++].val=x;
|
||||
x=val;
|
||||
}
|
||||
|
||||
void operator()(base_pointer& x,base_pointer val)
|
||||
{
|
||||
base_pointer_tracks[base_pointer_track_count].x=&x;
|
||||
base_pointer_tracks[base_pointer_track_count++].val=x;
|
||||
x=val;
|
||||
}
|
||||
|
||||
void operator()() /* undo op */
|
||||
{
|
||||
/* in the absence of aliasing, restitution order is immaterial */
|
||||
|
||||
while(pointer_track_count--){
|
||||
*(pointer_tracks[pointer_track_count].x)=
|
||||
pointer_tracks[pointer_track_count].val;
|
||||
}
|
||||
while(base_pointer_track_count--){
|
||||
*(base_pointer_tracks[base_pointer_track_count].x)=
|
||||
base_pointer_tracks[base_pointer_track_count].val;
|
||||
}
|
||||
}
|
||||
|
||||
struct pointer_track {pointer* x; pointer val;};
|
||||
struct base_pointer_track{base_pointer* x; base_pointer val;};
|
||||
|
||||
/* We know the maximum number of pointer and base pointer assignments that
|
||||
* the two unlink versions do, so we can statically reserve the needed
|
||||
* storage.
|
||||
*/
|
||||
|
||||
pointer_track pointer_tracks[3];
|
||||
int pointer_track_count;
|
||||
base_pointer_track base_pointer_tracks[2];
|
||||
int base_pointer_track_count;
|
||||
};
|
||||
|
||||
/* algorithmic stuff for unique and non-unique variants */
|
||||
|
||||
struct hashed_unique_tag{};
|
||||
struct hashed_non_unique_tag{};
|
||||
|
||||
template<typename Node,typename Category>
|
||||
struct hashed_index_node_alg;
|
||||
|
||||
template<typename Node>
|
||||
struct hashed_index_node_alg<Node,hashed_unique_tag>
|
||||
{
|
||||
typedef typename Node::base_pointer base_pointer;
|
||||
typedef typename Node::const_base_pointer const_base_pointer;
|
||||
typedef typename Node::pointer pointer;
|
||||
typedef typename Node::const_pointer const_pointer;
|
||||
|
||||
static bool is_first_of_bucket(pointer x)
|
||||
{
|
||||
return x->prior()->next()!=x;
|
||||
}
|
||||
|
||||
static pointer after(pointer x)
|
||||
{
|
||||
return x->next();
|
||||
}
|
||||
|
||||
static pointer after_local(pointer x)
|
||||
{
|
||||
return is_last_of_bucket(x)?pointer(0):after(x);
|
||||
}
|
||||
|
||||
static pointer next_to_inspect(pointer x)
|
||||
{
|
||||
pointer y=x->next();
|
||||
if(y->prior()==base_pointer_from(x))return y;
|
||||
else return pointer(0); /* x last of bucket, bucket finished */
|
||||
}
|
||||
|
||||
static void link(pointer x,base_pointer buc,pointer end)
|
||||
{
|
||||
if(buc->next()==pointer(0)){ /* empty bucket */
|
||||
x->next()=end->next();
|
||||
x->next()->prior()->next()=x;
|
||||
x->prior()=buc;
|
||||
buc->next()=end;
|
||||
end->next()=x;
|
||||
}
|
||||
else{
|
||||
x->next()=buc->next()->next();
|
||||
x->next()->prior()=base_pointer_from(x);
|
||||
x->prior()=buc;
|
||||
buc->next()->next()=x;
|
||||
}
|
||||
};
|
||||
|
||||
static void unlink(pointer x)
|
||||
{
|
||||
default_assigner assign;
|
||||
unlink(x,assign);
|
||||
}
|
||||
|
||||
typedef unlink_undo_assigner<Node> unlink_undo;
|
||||
|
||||
template<typename Assigner>
|
||||
static void unlink(pointer x,Assigner& assign)
|
||||
{
|
||||
if(is_first_of_bucket(x)){
|
||||
if(is_last_of_bucket(x)){
|
||||
assign(x->prior()->next()->next(),x->next());
|
||||
assign(x->next()->prior()->next(),x->prior()->next());
|
||||
assign(x->prior()->next(),pointer(0));
|
||||
}
|
||||
else{
|
||||
assign(x->prior()->next()->next(),x->next());
|
||||
assign(x->next()->prior(),x->prior());
|
||||
}
|
||||
}
|
||||
else if(is_last_of_bucket(x)){
|
||||
assign(x->prior()->next(),x->next());
|
||||
assign(x->next()->prior()->next(),pointer_from(x->prior()));
|
||||
}
|
||||
else{
|
||||
assign(x->prior()->next(),x->next());
|
||||
assign(x->next()->prior(),x->prior());
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
static pointer pointer_from(base_pointer x)
|
||||
{
|
||||
return Node::pointer_from(x);
|
||||
}
|
||||
|
||||
static base_pointer base_pointer_from(pointer x)
|
||||
{
|
||||
return Node::base_pointer_from(x);
|
||||
}
|
||||
|
||||
static bool is_last_of_bucket(pointer x)
|
||||
{
|
||||
return x->next()->prior()!=base_pointer_from(x);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Node>
|
||||
struct hashed_index_node_alg<Node,hashed_non_unique_tag>
|
||||
{
|
||||
typedef typename Node::base_pointer base_pointer;
|
||||
typedef typename Node::const_base_pointer const_base_pointer;
|
||||
typedef typename Node::pointer pointer;
|
||||
typedef typename Node::const_pointer const_pointer;
|
||||
|
||||
static bool is_first_of_bucket(pointer x)
|
||||
{
|
||||
return x->prior()->next()->next()==x;
|
||||
}
|
||||
|
||||
static bool is_first_of_group(pointer x)
|
||||
{
|
||||
return
|
||||
x->next()->prior()!=base_pointer_from(x)&&
|
||||
!is_first_of_bucket(x->next())&&
|
||||
pointer_from(x->next()->prior())->prior()->next()==base_pointer_from(x);
|
||||
}
|
||||
|
||||
static pointer after(pointer x)
|
||||
{
|
||||
if(is_last_but_one_of_group(x)){
|
||||
return pointer_from(x->next()->next()->prior());
|
||||
}
|
||||
else{
|
||||
return x->next();
|
||||
}
|
||||
}
|
||||
|
||||
static pointer after_local(pointer x)
|
||||
{
|
||||
return is_last_of_bucket(x)?pointer(0):after(x);
|
||||
}
|
||||
|
||||
static pointer next_to_inspect(pointer x)
|
||||
{
|
||||
pointer y=x->next();
|
||||
if(y->prior()==base_pointer_from(x))return y;
|
||||
pointer z=y->prior()->next();
|
||||
if(z==x|| /* x last of bucket */
|
||||
z->prior()->next()!=z) /* group(x) last of bucket */
|
||||
return pointer(0); /* bucket finished */
|
||||
else return z;
|
||||
}
|
||||
|
||||
static void link(pointer x,base_pointer buc,pointer end)
|
||||
{
|
||||
if(buc->next()==pointer(0)){ /* empty bucket */
|
||||
x->next()=end->next();
|
||||
x->next()->prior()->next()=x;
|
||||
x->prior()=buc;
|
||||
buc->next()=end;
|
||||
end->next()=x;
|
||||
}
|
||||
else{
|
||||
x->next()=buc->next()->next();
|
||||
x->next()->prior()=base_pointer_from(x);
|
||||
x->prior()=buc;
|
||||
buc->next()->next()=x;
|
||||
}
|
||||
};
|
||||
|
||||
static void link(pointer x,pointer first,pointer last)
|
||||
{
|
||||
x->prior()=first->prior();
|
||||
x->next()=first;
|
||||
if(is_first_of_bucket(first)){
|
||||
x->prior()->next()->next()=x;
|
||||
}
|
||||
else{
|
||||
x->prior()->next()=x;
|
||||
}
|
||||
|
||||
if(first==last){
|
||||
last->prior()=base_pointer_from(x);
|
||||
}
|
||||
else if(first->next()==last){
|
||||
first->prior()=base_pointer_from(last);
|
||||
first->next()=x;
|
||||
}
|
||||
else{
|
||||
pointer second=first->next(),
|
||||
lastbutone=pointer_from(last->prior());
|
||||
second->prior()=base_pointer_from(first);
|
||||
first->prior()=base_pointer_from(last);
|
||||
lastbutone->next()=x;
|
||||
}
|
||||
}
|
||||
|
||||
static void link_range(
|
||||
pointer first,pointer last,base_pointer buc,pointer cend)
|
||||
{
|
||||
if(buc->next()==pointer(0)){ /* empty bucket */
|
||||
last->next()=cend->next();
|
||||
last->next()->prior()->next()=last;
|
||||
first->prior()=buc;
|
||||
buc->next()=cend;
|
||||
cend->next()=first;
|
||||
}
|
||||
else{
|
||||
last->next()=buc->next()->next();
|
||||
last->next()->prior()=base_pointer_from(last);
|
||||
first->prior()=buc;
|
||||
buc->next()->next()=first;
|
||||
}
|
||||
}
|
||||
|
||||
static void unlink(pointer x)
|
||||
{
|
||||
default_assigner assign;
|
||||
unlink(x,assign);
|
||||
}
|
||||
|
||||
typedef unlink_undo_assigner<Node> unlink_undo;
|
||||
|
||||
template<typename Assigner>
|
||||
static void unlink(pointer x,Assigner& assign)
|
||||
{
|
||||
if(x->prior()->next()==x){
|
||||
if(x->next()->prior()==base_pointer_from(x)){
|
||||
left_unlink(x,assign);
|
||||
right_unlink(x,assign);
|
||||
}
|
||||
else if(x->next()->prior()->next()==x){ /* last of bucket */
|
||||
left_unlink(x,assign);
|
||||
right_unlink_last_of_bucket(x,assign);
|
||||
}
|
||||
else if(x->next()->next()==x){ /* first of group size==3 */
|
||||
left_unlink(x,assign);
|
||||
assign(x->next()->next(),pointer_from(x->next()->prior()));
|
||||
right_unlink(x,assign);
|
||||
}
|
||||
else if(
|
||||
x->next()->next()->prior()==
|
||||
base_pointer_from(x->next())){ /* first of group size>3 */
|
||||
left_unlink(x,assign);
|
||||
right_unlink_first_of_group_gt_3(x,assign);
|
||||
}
|
||||
else{ /* n-1 of group size>3 */
|
||||
unlink_last_but_one_of_group_gt_3(x,assign);
|
||||
}
|
||||
}
|
||||
else if(x->prior()->next()->next()==x){ /* first of bucket */
|
||||
if(x->next()->prior()==base_pointer_from(x)){
|
||||
left_unlink_first_of_bucket(x,assign);
|
||||
right_unlink(x,assign);
|
||||
}
|
||||
else if(x->next()->prior()->next()==x){ /* last of bucket */
|
||||
left_unlink_first_of_bucket(x,assign);
|
||||
assign(x->next()->prior()->next(),x->prior()->next());
|
||||
assign(x->prior()->next(),pointer(0));
|
||||
}
|
||||
else{ /* first of group */
|
||||
left_unlink_first_of_bucket(x,assign);
|
||||
right_unlink_first_of_group(x,assign);
|
||||
}
|
||||
}
|
||||
else if(x->prior()->next()->next()->prior()==
|
||||
base_pointer_from(x)){ /* last of group */
|
||||
if(x->next()->prior()==base_pointer_from(x)){
|
||||
left_unlink_last_of_group(x,assign);
|
||||
right_unlink(x,assign);
|
||||
}
|
||||
else{ /* last of bucket */
|
||||
left_unlink_last_of_group(x,assign);
|
||||
right_unlink_last_of_bucket(x,assign);
|
||||
}
|
||||
}
|
||||
else{ /* second of group */
|
||||
unlink_second_of_group(x,assign);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
static pointer pointer_from(base_pointer x)
|
||||
{
|
||||
return Node::pointer_from(x);
|
||||
}
|
||||
|
||||
static base_pointer base_pointer_from(pointer x)
|
||||
{
|
||||
return Node::base_pointer_from(x);
|
||||
}
|
||||
|
||||
static bool is_last_of_bucket(pointer x)
|
||||
{
|
||||
return x->next()->prior()->next()==x;
|
||||
}
|
||||
|
||||
static bool is_last_but_one_of_group(pointer x)
|
||||
{
|
||||
return
|
||||
x->next()->prior()!=base_pointer_from(x)&&
|
||||
!is_last_of_bucket(x->next())&&
|
||||
pointer_from(x->next()->next()->prior())->prior()==base_pointer_from(x);
|
||||
}
|
||||
|
||||
template<typename Assigner>
|
||||
static void left_unlink(pointer x,Assigner& assign)
|
||||
{
|
||||
assign(x->prior()->next(),x->next());
|
||||
}
|
||||
|
||||
template<typename Assigner>
|
||||
static void right_unlink(pointer x,Assigner& assign)
|
||||
{
|
||||
assign(x->next()->prior(),x->prior());
|
||||
}
|
||||
|
||||
template<typename Assigner>
|
||||
static void left_unlink_first_of_bucket(pointer x,Assigner& assign)
|
||||
{
|
||||
assign(x->prior()->next()->next(),x->next());
|
||||
}
|
||||
|
||||
template<typename Assigner>
|
||||
static void right_unlink_last_of_bucket(pointer x,Assigner& assign)
|
||||
{
|
||||
assign(x->next()->prior()->next(),pointer_from(x->prior()));
|
||||
}
|
||||
|
||||
template<typename Assigner>
|
||||
static void right_unlink_first_of_group(pointer x,Assigner& assign)
|
||||
{
|
||||
pointer second=x->next(),
|
||||
last=pointer_from(second->prior()),
|
||||
lastbutone=pointer_from(last->prior());
|
||||
if(second==lastbutone){
|
||||
assign(second->next(),last);
|
||||
assign(second->prior(),x->prior());
|
||||
}
|
||||
else{
|
||||
assign(lastbutone->next(),second);
|
||||
assign(second->next()->prior(),base_pointer_from(last));
|
||||
assign(second->prior(),x->prior());
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Assigner>
|
||||
static void right_unlink_first_of_group_gt_3(pointer x,Assigner& assign)
|
||||
{
|
||||
pointer second=x->next(),
|
||||
last=pointer_from(second->prior()),
|
||||
lastbutone=pointer_from(last->prior());
|
||||
assign(lastbutone->next(),second);
|
||||
assign(second->next()->prior(),base_pointer_from(last));
|
||||
assign(second->prior(),x->prior());
|
||||
}
|
||||
|
||||
template<typename Assigner>
|
||||
static void left_unlink_last_of_group(pointer x,Assigner& assign)
|
||||
{
|
||||
pointer lastbutone=pointer_from(x->prior()),
|
||||
first=lastbutone->next(),
|
||||
second=first->next();
|
||||
if(lastbutone==second){
|
||||
assign(lastbutone->prior(),base_pointer_from(first));
|
||||
assign(lastbutone->next(),x->next());
|
||||
}
|
||||
else{
|
||||
assign(second->prior(),base_pointer_from(lastbutone));
|
||||
assign(lastbutone->prior()->next(),first);
|
||||
assign(lastbutone->next(),x->next());
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Assigner>
|
||||
static void unlink_last_but_one_of_group_gt_3(pointer x,Assigner& assign)
|
||||
{
|
||||
pointer first=x->next(),
|
||||
second=first->next(),
|
||||
last=pointer_from(second->prior());
|
||||
assign(last->prior(),x->prior());
|
||||
assign(x->prior()->next(),first);
|
||||
}
|
||||
|
||||
template<typename Assigner>
|
||||
static void unlink_second_of_group(pointer x,Assigner& assign)
|
||||
{
|
||||
pointer last=pointer_from(x->prior()),
|
||||
lastbutone=pointer_from(last->prior()),
|
||||
first=lastbutone->next();
|
||||
if(lastbutone==x){
|
||||
assign(first->next(),last);
|
||||
assign(last->prior(),base_pointer_from(first));
|
||||
}
|
||||
else{
|
||||
assign(first->next(),x->next());
|
||||
assign(x->next()->prior(),base_pointer_from(last));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Super>
|
||||
struct hashed_index_node:Super,hashed_index_node_trampoline<Super>
|
||||
struct hashed_index_node_trampoline:
|
||||
hashed_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
typename Super::allocator_type,
|
||||
char
|
||||
>::type
|
||||
>
|
||||
{
|
||||
typedef typename boost::detail::allocator::rebind_to<
|
||||
typename Super::allocator_type,
|
||||
char
|
||||
>::type impl_allocator_type;
|
||||
typedef hashed_index_node_impl<impl_allocator_type> impl_type;
|
||||
};
|
||||
|
||||
template<typename Super,typename Category>
|
||||
struct hashed_index_node:
|
||||
Super,hashed_index_node_trampoline<Super>
|
||||
{
|
||||
private:
|
||||
typedef hashed_index_node_trampoline<Super> trampoline;
|
||||
|
||||
public:
|
||||
typedef typename trampoline::impl_type impl_type;
|
||||
typedef typename trampoline::pointer impl_pointer;
|
||||
typedef typename trampoline::const_pointer const_impl_pointer;
|
||||
typedef typename trampoline::impl_type impl_type;
|
||||
typedef hashed_index_node_alg<
|
||||
impl_type,Category> node_alg;
|
||||
typedef typename trampoline::base_pointer impl_base_pointer;
|
||||
typedef typename trampoline::const_base_pointer const_impl_base_pointer;
|
||||
typedef typename trampoline::pointer impl_pointer;
|
||||
typedef typename trampoline::const_pointer const_impl_pointer;
|
||||
|
||||
impl_pointer& next(){return trampoline::next();}
|
||||
impl_pointer next()const{return trampoline::next();}
|
||||
impl_base_pointer& prior(){return trampoline::prior();}
|
||||
impl_base_pointer prior()const{return trampoline::prior();}
|
||||
|
||||
impl_pointer impl()
|
||||
{
|
||||
@ -147,12 +673,16 @@ public:
|
||||
static_cast<const trampoline*>(&*x));
|
||||
}
|
||||
|
||||
static void increment(
|
||||
hashed_index_node*& x,impl_pointer bbegin,impl_pointer bend)
|
||||
/* interoperability with hashed_index_iterator */
|
||||
|
||||
static void increment(hashed_index_node*& x)
|
||||
{
|
||||
impl_pointer xi=x->impl();
|
||||
trampoline::increment(xi,bbegin,bend);
|
||||
x=from_impl(xi);
|
||||
x=from_impl(node_alg::after(x->impl()));
|
||||
}
|
||||
|
||||
static void increment_local(hashed_index_node*& x)
|
||||
{
|
||||
x=from_impl(node_alg::after_local(x->impl()));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_HEADER_HOLDER_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_HEADER_HOLDER_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -9,12 +9,13 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_INDEX_BASE_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_INDEX_BASE_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||
#include <boost/detail/allocator_utilities.hpp>
|
||||
#include <boost/detail/no_exceptions_support.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/move/core.hpp>
|
||||
#include <boost/move/utility.hpp>
|
||||
@ -61,9 +62,10 @@ protected:
|
||||
Value,IndexSpecifierList,Allocator> final_type;
|
||||
typedef tuples::null_type ctor_args_list;
|
||||
typedef typename
|
||||
boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
typename Allocator::value_type>::type final_allocator_type;
|
||||
boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
typename Allocator::value_type
|
||||
>::type final_allocator_type;
|
||||
typedef mpl::vector0<> index_type_list;
|
||||
typedef mpl::vector0<> iterator_type_list;
|
||||
typedef mpl::vector0<> const_iterator_type_list;
|
||||
@ -96,43 +98,60 @@ protected:
|
||||
const index_base<Value,IndexSpecifierList,Allocator>&,const copy_map_type&)
|
||||
{}
|
||||
|
||||
node_type* insert_(const value_type& v,node_type* x,lvalue_tag)
|
||||
final_node_type* insert_(const value_type& v,final_node_type*& x,lvalue_tag)
|
||||
{
|
||||
boost::detail::allocator::construct(&x->value(),v);
|
||||
x=final().allocate_node();
|
||||
BOOST_TRY{
|
||||
boost::detail::allocator::construct(&x->value(),v);
|
||||
}
|
||||
BOOST_CATCH(...){
|
||||
final().deallocate_node(x);
|
||||
BOOST_RETHROW;
|
||||
}
|
||||
BOOST_CATCH_END
|
||||
return x;
|
||||
}
|
||||
|
||||
node_type* insert_(const value_type& v,node_type* x,rvalue_tag)
|
||||
final_node_type* insert_(const value_type& v,final_node_type*& x,rvalue_tag)
|
||||
{
|
||||
/* This shoud have used a modified, T&&-compatible version of
|
||||
* boost::detail::allocator::construct, but
|
||||
* <boost/detail/allocator_utilities.hpp> is too old and venerable to mess
|
||||
* with; besides, it is a general internal utility and the imperfect
|
||||
* perfect forwarding emulation of Boost.Move might break other libs.
|
||||
*/
|
||||
x=final().allocate_node();
|
||||
BOOST_TRY{
|
||||
/* This shoud have used a modified, T&&-compatible version of
|
||||
* boost::detail::allocator::construct, but
|
||||
* <boost/detail/allocator_utilities.hpp> is too old and venerable to
|
||||
* mess with; besides, it is a general internal utility and the imperfect
|
||||
* perfect forwarding emulation of Boost.Move might break other libs.
|
||||
*/
|
||||
|
||||
new (&x->value()) value_type(boost::move(const_cast<value_type&>(v)));
|
||||
new (&x->value()) value_type(boost::move(const_cast<value_type&>(v)));
|
||||
}
|
||||
BOOST_CATCH(...){
|
||||
final().deallocate_node(x);
|
||||
BOOST_RETHROW;
|
||||
}
|
||||
BOOST_CATCH_END
|
||||
return x;
|
||||
}
|
||||
|
||||
node_type* insert_(const value_type&,node_type* x,emplaced_tag)
|
||||
final_node_type* insert_(const value_type&,final_node_type*& x,emplaced_tag)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
node_type* insert_(const value_type& v,node_type*,node_type* x,lvalue_tag)
|
||||
final_node_type* insert_(
|
||||
const value_type& v,node_type*,final_node_type*& x,lvalue_tag)
|
||||
{
|
||||
boost::detail::allocator::construct(&x->value(),v);
|
||||
return x;
|
||||
return insert_(v,x,lvalue_tag());
|
||||
}
|
||||
|
||||
node_type* insert_(const value_type& v,node_type*,node_type* x,rvalue_tag)
|
||||
final_node_type* insert_(
|
||||
const value_type& v,node_type*,final_node_type*& x,rvalue_tag)
|
||||
{
|
||||
new (&x->value()) value_type(boost::move(const_cast<value_type&>(v)));
|
||||
return x;
|
||||
return insert_(v,x,rvalue_tag());
|
||||
}
|
||||
|
||||
node_type* insert_(const value_type&,node_type*,node_type* x,emplaced_tag)
|
||||
final_node_type* insert_(
|
||||
const value_type&,node_type*,final_node_type*& x,emplaced_tag)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_INDEX_LOADER_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_INDEX_LOADER_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_INDEX_MATCHER_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_INDEX_MATCHER_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_INDEX_NODE_BASE_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_INDEX_NODE_BASE_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -85,9 +85,7 @@ private:
|
||||
};
|
||||
|
||||
template<typename Node,typename Value>
|
||||
Node* node_from_value(
|
||||
const Value* p
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(Node))
|
||||
Node* node_from_value(const Value* p)
|
||||
{
|
||||
typedef typename Node::allocator_type allocator_type;
|
||||
return static_cast<Node*>(
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_INDEX_SAVER_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_INDEX_SAVER_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_INVARIANT_ASSERT_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_INVARIANT_ASSERT_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_IS_INDEX_LIST_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_IS_INDEX_LIST_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,13 +9,12 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_ITER_ADAPTOR_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_ITER_ADAPTOR_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||
#include <boost/mpl/apply.hpp>
|
||||
#include <boost/multi_index/detail/prevent_eti.hpp>
|
||||
#include <boost/operators.hpp>
|
||||
|
||||
namespace boost{
|
||||
@ -294,12 +293,9 @@ template<class Derived,class Base>
|
||||
struct iter_adaptor_base
|
||||
{
|
||||
typedef iter_adaptor_selector<
|
||||
typename Base::iterator_category> selector;
|
||||
typedef typename prevent_eti<
|
||||
selector,
|
||||
typename mpl::apply2<
|
||||
selector,Derived,Base>::type
|
||||
>::type type;
|
||||
typename Base::iterator_category> selector;
|
||||
typedef typename mpl::apply2<
|
||||
selector,Derived,Base>::type type;
|
||||
};
|
||||
|
||||
template<class Derived,class Base>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_MODIFY_KEY_ADAPTOR_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_MODIFY_KEY_ADAPTOR_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,69 +0,0 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* See http://www.boost.org/libs/multi_index for library home page.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_MSVC_INDEX_SPECIFIER_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_MSVC_INDEX_SPECIFIER_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1310)
|
||||
/* Workaround for a problem in MSVC with dependent template typedefs
|
||||
* when accesing index specifiers.
|
||||
* Modeled after <boost/mpl/aux_/msvc_dtw.hpp> (thanks, Aleksey!)
|
||||
*/
|
||||
|
||||
#include <boost/mpl/aux_/msvc_never_true.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace multi_index{
|
||||
|
||||
namespace detail{
|
||||
|
||||
template<typename IndexSpecifier>
|
||||
struct msvc_index_specifier
|
||||
{
|
||||
template<bool> struct fake_index_type:IndexSpecifier{};
|
||||
template<> struct fake_index_type<true>
|
||||
{
|
||||
template<typename Super>
|
||||
struct node_class{};
|
||||
|
||||
template<typename Super>
|
||||
struct index_class{};
|
||||
};
|
||||
|
||||
template<typename Super>
|
||||
struct result_node_class:
|
||||
fake_index_type<mpl::aux::msvc_never_true<IndexSpecifier>::value>::
|
||||
template node_class<Super>
|
||||
{
|
||||
};
|
||||
|
||||
template<typename Super>
|
||||
struct result_index_class:
|
||||
fake_index_type<mpl::aux::msvc_never_true<IndexSpecifier>::value>::
|
||||
template index_class<Super>
|
||||
{
|
||||
};
|
||||
};
|
||||
|
||||
} /* namespace multi_index::detail */
|
||||
|
||||
} /* namespace multi_index */
|
||||
|
||||
} /* namespace boost */
|
||||
|
||||
#endif /* workaround */
|
||||
|
||||
#endif
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_NO_DUPLICATE_TAGS_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_NO_DUPLICATE_TAGS_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_NODE_TYPE_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_NODE_TYPE_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -22,7 +22,6 @@
|
||||
#include <boost/multi_index/detail/header_holder.hpp>
|
||||
#include <boost/multi_index/detail/index_node_base.hpp>
|
||||
#include <boost/multi_index/detail/is_index_list.hpp>
|
||||
#include <boost/multi_index/detail/msvc_index_specifier.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost{
|
||||
@ -35,17 +34,6 @@ namespace detail{
|
||||
* index list.
|
||||
*/
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1310)
|
||||
struct index_node_applier
|
||||
{
|
||||
template<typename IndexSpecifierIterator,typename Super>
|
||||
struct apply:
|
||||
msvc_index_specifier< mpl::deref<IndexSpecifierIterator>::type >::
|
||||
template result_node_class<Super>
|
||||
{
|
||||
};
|
||||
};
|
||||
#else
|
||||
struct index_node_applier
|
||||
{
|
||||
template<typename IndexSpecifierIterator,typename Super>
|
||||
@ -56,7 +44,6 @@ struct index_node_applier
|
||||
BOOST_NESTED_TEMPLATE node_class<Super>::type type;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
template<typename Value,typename IndexSpecifierList,typename Allocator>
|
||||
struct multi_index_node_type
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_ORD_INDEX_ARGS_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_ORD_INDEX_ARGS_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -36,14 +36,13 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_ORD_INDEX_NODE_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_ORD_INDEX_NODE_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||
#include <cstddef>
|
||||
#include <boost/detail/allocator_utilities.hpp>
|
||||
#include <boost/multi_index/detail/prevent_eti.hpp>
|
||||
|
||||
#if !defined(BOOST_MULTI_INDEX_DISABLE_COMPRESSED_ORDERED_INDEX_NODES)
|
||||
#include <boost/mpl/and.hpp>
|
||||
@ -70,22 +69,18 @@ struct ordered_index_node_impl; /* fwd decl. */
|
||||
template<typename Allocator>
|
||||
struct ordered_index_node_std_base
|
||||
{
|
||||
typedef typename prevent_eti<
|
||||
typedef typename
|
||||
boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
ordered_index_node_impl<Allocator>
|
||||
>::type
|
||||
>::type::pointer pointer;
|
||||
typedef typename prevent_eti<
|
||||
ordered_index_node_impl<Allocator>
|
||||
>::type::pointer pointer;
|
||||
typedef typename
|
||||
boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
ordered_index_node_impl<Allocator>
|
||||
>::type
|
||||
>::type::const_pointer const_pointer;
|
||||
typedef ordered_index_color& color_ref;
|
||||
typedef pointer& parent_ref;
|
||||
ordered_index_node_impl<Allocator>
|
||||
>::type::const_pointer const_pointer;
|
||||
typedef ordered_index_color& color_ref;
|
||||
typedef pointer& parent_ref;
|
||||
|
||||
ordered_index_color& color(){return color_;}
|
||||
ordered_index_color color()const{return color_;}
|
||||
@ -216,12 +211,9 @@ struct ordered_index_node_impl_base:
|
||||
!(has_uintptr_type::value)||
|
||||
(alignment_of<ordered_index_node_compressed_base<Allocator> >::value%2)||
|
||||
!(is_same<
|
||||
typename prevent_eti<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
ordered_index_node_impl<Allocator>
|
||||
>::type
|
||||
ordered_index_node_impl<Allocator>
|
||||
>::type::pointer,
|
||||
ordered_index_node_impl<Allocator>*>::value),
|
||||
ordered_index_node_std_base<Allocator>,
|
||||
@ -557,25 +549,19 @@ public:
|
||||
|
||||
template<typename Super>
|
||||
struct ordered_index_node_trampoline:
|
||||
prevent_eti<
|
||||
Super,
|
||||
ordered_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
typename Super::allocator_type,
|
||||
char
|
||||
>::type
|
||||
>
|
||||
>::type
|
||||
ordered_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
typename Super::allocator_type,
|
||||
char
|
||||
>::type
|
||||
>
|
||||
{
|
||||
typedef typename prevent_eti<
|
||||
Super,
|
||||
ordered_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
typename Super::allocator_type,
|
||||
char
|
||||
>::type
|
||||
>
|
||||
>::type impl_type;
|
||||
typedef ordered_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
typename Super::allocator_type,
|
||||
char
|
||||
>::type
|
||||
> impl_type;
|
||||
};
|
||||
|
||||
template<typename Super>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -36,7 +36,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_ORD_INDEX_OPS_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_ORD_INDEX_OPS_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,60 +0,0 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* See http://www.boost.org/libs/multi_index for library home page.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_PREVENT_ETI_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_PREVENT_ETI_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/integral_c.hpp>
|
||||
#include <boost/mpl/aux_/msvc_never_true.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace multi_index{
|
||||
|
||||
namespace detail{
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
/* See
|
||||
* http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Effective_MPL
|
||||
* Item 5.6, Beware of the 'early template instantiation' trap.
|
||||
*/
|
||||
|
||||
template<typename Type,typename Construct>
|
||||
struct prevent_eti
|
||||
{
|
||||
typedef typename mpl::if_<
|
||||
mpl::aux::msvc_never_true<Type>,
|
||||
mpl::integral_c<int,0>,
|
||||
Construct
|
||||
>::type type;
|
||||
};
|
||||
#else
|
||||
template<typename Type,typename Construct>
|
||||
struct prevent_eti
|
||||
{
|
||||
typedef Construct type;
|
||||
};
|
||||
#endif
|
||||
|
||||
} /* namespace multi_index::detail */
|
||||
|
||||
} /* namespace multi_index */
|
||||
|
||||
} /* namespace boost */
|
||||
|
||||
#endif
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_RND_INDEX_LOADER_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_RND_INDEX_LOADER_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
#include <algorithm>
|
||||
#include <boost/detail/allocator_utilities.hpp>
|
||||
#include <boost/multi_index/detail/auto_space.hpp>
|
||||
#include <boost/multi_index/detail/prevent_eti.hpp>
|
||||
#include <boost/multi_index/detail/rnd_index_ptr_array.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <cstddef>
|
||||
@ -45,15 +44,12 @@ template<typename Allocator>
|
||||
class random_access_index_loader_base:private noncopyable
|
||||
{
|
||||
protected:
|
||||
typedef typename prevent_eti<
|
||||
Allocator,
|
||||
random_access_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
char
|
||||
>::type
|
||||
>
|
||||
>::type node_impl_type;
|
||||
typedef random_access_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
char
|
||||
>::type
|
||||
> node_impl_type;
|
||||
typedef typename node_impl_type::pointer node_impl_pointer;
|
||||
typedef random_access_index_ptr_array<Allocator> ptr_array;
|
||||
|
||||
@ -86,14 +82,14 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
void rearrange(node_impl_pointer position,node_impl_pointer x)
|
||||
void rearrange(node_impl_pointer position_,node_impl_pointer x)
|
||||
{
|
||||
preprocess(); /* only incur this penalty if rearrange() is ever called */
|
||||
if(position==node_impl_pointer(0))position=header;
|
||||
if(position_==node_impl_pointer(0))position_=header;
|
||||
next(prev(x))=next(x);
|
||||
prev(next(x))=prev(x);
|
||||
prev(x)=position;
|
||||
next(x)=next(position);
|
||||
prev(x)=position_;
|
||||
next(x)=next(position_);
|
||||
next(prev(x))=prev(next(x))=x;
|
||||
}
|
||||
|
||||
@ -161,9 +157,10 @@ public:
|
||||
super(al_,ptrs_)
|
||||
{}
|
||||
|
||||
void rearrange(Node* position,Node *x)
|
||||
void rearrange(Node* position_,Node *x)
|
||||
{
|
||||
super::rearrange(position?position->impl():node_impl_pointer(0),x->impl());
|
||||
super::rearrange(
|
||||
position_?position_->impl():node_impl_pointer(0),x->impl());
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_RND_INDEX_NODE_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_RND_INDEX_NODE_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
#include <algorithm>
|
||||
#include <boost/detail/allocator_utilities.hpp>
|
||||
#include <boost/math/common_factor_rt.hpp>
|
||||
#include <boost/multi_index/detail/prevent_eti.hpp>
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
|
||||
@ -30,24 +29,18 @@ namespace detail{
|
||||
template<typename Allocator>
|
||||
struct random_access_index_node_impl
|
||||
{
|
||||
typedef typename prevent_eti<
|
||||
Allocator,
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,random_access_index_node_impl
|
||||
>::type
|
||||
>::type::pointer pointer;
|
||||
typedef typename prevent_eti<
|
||||
Allocator,
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,random_access_index_node_impl
|
||||
>::type
|
||||
>::type::const_pointer const_pointer;
|
||||
typedef typename prevent_eti<
|
||||
Allocator,
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,pointer
|
||||
>::type
|
||||
>::type::pointer ptr_pointer;
|
||||
typedef typename
|
||||
boost::detail::allocator::rebind_to<
|
||||
Allocator,random_access_index_node_impl
|
||||
>::type::pointer pointer;
|
||||
typedef typename
|
||||
boost::detail::allocator::rebind_to<
|
||||
Allocator,random_access_index_node_impl
|
||||
>::type::const_pointer const_pointer;
|
||||
typedef typename
|
||||
boost::detail::allocator::rebind_to<
|
||||
Allocator,pointer
|
||||
>::type::pointer ptr_pointer;
|
||||
|
||||
ptr_pointer& up(){return up_;}
|
||||
ptr_pointer up()const{return up_;}
|
||||
@ -181,25 +174,19 @@ private:
|
||||
|
||||
template<typename Super>
|
||||
struct random_access_index_node_trampoline:
|
||||
prevent_eti<
|
||||
Super,
|
||||
random_access_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
typename Super::allocator_type,
|
||||
char
|
||||
>::type
|
||||
>
|
||||
>::type
|
||||
random_access_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
typename Super::allocator_type,
|
||||
char
|
||||
>::type
|
||||
>
|
||||
{
|
||||
typedef typename prevent_eti<
|
||||
Super,
|
||||
random_access_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
typename Super::allocator_type,
|
||||
char
|
||||
>::type
|
||||
>
|
||||
>::type impl_type;
|
||||
typedef random_access_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
typename Super::allocator_type,
|
||||
char
|
||||
>::type
|
||||
> impl_type;
|
||||
};
|
||||
|
||||
template<typename Super>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2009 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_RND_INDEX_OPS_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_RND_INDEX_OPS_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -30,8 +30,7 @@ namespace detail{
|
||||
|
||||
template<typename Node,typename Allocator,typename Predicate>
|
||||
Node* random_access_index_remove(
|
||||
random_access_index_ptr_array<Allocator>& ptrs,Predicate pred
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(Node))
|
||||
random_access_index_ptr_array<Allocator>& ptrs,Predicate pred)
|
||||
{
|
||||
typedef typename Node::value_type value_type;
|
||||
typedef typename Node::impl_ptr_pointer impl_ptr_pointer;
|
||||
@ -55,8 +54,7 @@ Node* random_access_index_remove(
|
||||
|
||||
template<typename Node,typename Allocator,class BinaryPredicate>
|
||||
Node* random_access_index_unique(
|
||||
random_access_index_ptr_array<Allocator>& ptrs,BinaryPredicate binary_pred
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(Node))
|
||||
random_access_index_ptr_array<Allocator>& ptrs,BinaryPredicate binary_pred)
|
||||
{
|
||||
typedef typename Node::value_type value_type;
|
||||
typedef typename Node::impl_ptr_pointer impl_ptr_pointer;
|
||||
@ -86,8 +84,7 @@ template<typename Node,typename Allocator,typename Compare>
|
||||
void random_access_index_inplace_merge(
|
||||
const Allocator& al,
|
||||
random_access_index_ptr_array<Allocator>& ptrs,
|
||||
BOOST_DEDUCED_TYPENAME Node::impl_ptr_pointer first1,Compare comp
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(Node))
|
||||
BOOST_DEDUCED_TYPENAME Node::impl_ptr_pointer first1,Compare comp)
|
||||
{
|
||||
typedef typename Node::value_type value_type;
|
||||
typedef typename Node::impl_pointer impl_pointer;
|
||||
@ -151,8 +148,7 @@ template<typename Node,typename Allocator,class Compare>
|
||||
void random_access_index_sort(
|
||||
const Allocator& al,
|
||||
random_access_index_ptr_array<Allocator>& ptrs,
|
||||
Compare comp
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(Node))
|
||||
Compare comp)
|
||||
{
|
||||
/* The implementation is extremely simple: an auxiliary
|
||||
* array of pointers is sorted using stdlib facilities and
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_RND_INDEX_PTR_ARRAY_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_RND_INDEX_PTR_ARRAY_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
#include <algorithm>
|
||||
#include <boost/detail/allocator_utilities.hpp>
|
||||
#include <boost/multi_index/detail/auto_space.hpp>
|
||||
#include <boost/multi_index/detail/prevent_eti.hpp>
|
||||
#include <boost/multi_index/detail/rnd_index_node.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <cstddef>
|
||||
@ -33,29 +32,23 @@ namespace detail{
|
||||
template<typename Allocator>
|
||||
class random_access_index_ptr_array:private noncopyable
|
||||
{
|
||||
typedef typename prevent_eti<
|
||||
Allocator,
|
||||
random_access_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
char
|
||||
>::type
|
||||
>
|
||||
>::type node_impl_type;
|
||||
typedef random_access_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
char
|
||||
>::type
|
||||
> node_impl_type;
|
||||
|
||||
public:
|
||||
typedef typename node_impl_type::pointer value_type;
|
||||
typedef typename prevent_eti<
|
||||
Allocator,
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,value_type
|
||||
>::type
|
||||
>::type::pointer pointer;
|
||||
typedef typename node_impl_type::pointer value_type;
|
||||
typedef typename boost::detail::allocator::rebind_to<
|
||||
Allocator,value_type
|
||||
>::type::pointer pointer;
|
||||
|
||||
random_access_index_ptr_array(
|
||||
const Allocator& al,value_type end_,std::size_t size):
|
||||
size_(size),
|
||||
capacity_(size),
|
||||
const Allocator& al,value_type end_,std::size_t sz):
|
||||
size_(sz),
|
||||
capacity_(sz),
|
||||
spc(al,capacity_+1)
|
||||
{
|
||||
*end()=end_;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_RND_NODE_ITERATOR_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_RND_NODE_ITERATOR_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,105 +0,0 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* See http://www.boost.org/libs/multi_index for library home page.
|
||||
*/
|
||||
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_SAFE_CTR_PROXY_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_SAFE_CTR_PROXY_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
#include <boost/multi_index/detail/safe_mode.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace multi_index{
|
||||
|
||||
namespace detail{
|
||||
|
||||
/* A safe iterator is instantiated in the form
|
||||
* safe_iterator<Iterator,Container>: MSVC++ 6.0 has serious troubles with
|
||||
* the resulting symbols names, given that index names (which stand for
|
||||
* Container) are fairly long themselves. safe_ctr_proxy does not statically
|
||||
* depend on Container, and provides the necessary methods (begin and end) to
|
||||
* the safe mode framework via an abstract interface. With safe_ctr_proxy,
|
||||
* instead of deriving from safe_container<Container> the following base class
|
||||
* must be used:
|
||||
*
|
||||
* safe_ctr_proxy_impl<Iterator,Container>
|
||||
*
|
||||
* where Iterator is the type of the *unsafe* iterator being wrapped.
|
||||
* The corresponding safe iterator instantiation is then
|
||||
*
|
||||
* safe_iterator<Iterator,safe_ctr_proxy<Iterator> >,
|
||||
*
|
||||
* which does not include the name of Container.
|
||||
*/
|
||||
|
||||
template<typename Iterator>
|
||||
class safe_ctr_proxy:
|
||||
public safe_mode::safe_container<safe_ctr_proxy<Iterator> >
|
||||
{
|
||||
public:
|
||||
typedef safe_mode::safe_iterator<Iterator,safe_ctr_proxy> iterator;
|
||||
typedef iterator const_iterator;
|
||||
|
||||
iterator begin(){return begin_impl();}
|
||||
const_iterator begin()const{return begin_impl();}
|
||||
iterator end(){return end_impl();}
|
||||
const_iterator end()const{return end_impl();}
|
||||
|
||||
protected:
|
||||
virtual iterator begin_impl()=0;
|
||||
virtual const_iterator begin_impl()const=0;
|
||||
virtual iterator end_impl()=0;
|
||||
virtual const_iterator end_impl()const=0;
|
||||
};
|
||||
|
||||
template<typename Iterator,typename Container>
|
||||
class safe_ctr_proxy_impl:public safe_ctr_proxy<Iterator>
|
||||
{
|
||||
typedef safe_ctr_proxy<Iterator> super;
|
||||
typedef Container container_type;
|
||||
|
||||
public:
|
||||
typedef typename super::iterator iterator;
|
||||
typedef typename super::const_iterator const_iterator;
|
||||
|
||||
virtual iterator begin_impl(){return container().begin();}
|
||||
virtual const_iterator begin_impl()const{return container().begin();}
|
||||
virtual iterator end_impl(){return container().end();}
|
||||
virtual const_iterator end_impl()const{return container().end();}
|
||||
|
||||
private:
|
||||
container_type& container()
|
||||
{
|
||||
return *static_cast<container_type*>(this);
|
||||
}
|
||||
|
||||
const container_type& container()const
|
||||
{
|
||||
return *static_cast<const container_type*>(this);
|
||||
}
|
||||
};
|
||||
|
||||
} /* namespace multi_index::detail */
|
||||
|
||||
} /* namespace multi_index */
|
||||
|
||||
} /* namespace boost */
|
||||
|
||||
#endif /* workaround */
|
||||
|
||||
#endif /* BOOST_MULTI_INDEX_ENABLE_SAFE_MODE */
|
||||
|
||||
#endif
|
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_SAFE_MODE_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_SAFE_MODE_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -116,6 +116,7 @@
|
||||
|
||||
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
|
||||
#include <boost/serialization/split_member.hpp>
|
||||
#include <boost/serialization/version.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_HAS_THREADS)
|
||||
@ -567,6 +568,19 @@ public:
|
||||
|
||||
} /* namespace multi_index */
|
||||
|
||||
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
|
||||
namespace serialization{
|
||||
template<typename Iterator,typename Container>
|
||||
struct version<
|
||||
boost::multi_index::safe_mode::safe_iterator<Iterator,Container>
|
||||
>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(
|
||||
int,value=boost::serialization::version<Iterator>::value);
|
||||
};
|
||||
} /* namespace serialization */
|
||||
#endif
|
||||
|
||||
} /* namespace boost */
|
||||
|
||||
#endif /* BOOST_MULTI_INDEX_ENABLE_SAFE_MODE */
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_SCOPE_GUARD_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_SCOPE_GUARD_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,14 +9,13 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_SEQ_INDEX_NODE_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_SEQ_INDEX_NODE_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||
#include <algorithm>
|
||||
#include <boost/detail/allocator_utilities.hpp>
|
||||
#include <boost/multi_index/detail/prevent_eti.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
@ -29,18 +28,14 @@ namespace detail{
|
||||
template<typename Allocator>
|
||||
struct sequenced_index_node_impl
|
||||
{
|
||||
typedef typename prevent_eti<
|
||||
Allocator,
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,sequenced_index_node_impl
|
||||
>::type
|
||||
>::type::pointer pointer;
|
||||
typedef typename prevent_eti<
|
||||
Allocator,
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,sequenced_index_node_impl
|
||||
>::type
|
||||
>::type::const_pointer const_pointer;
|
||||
typedef typename
|
||||
boost::detail::allocator::rebind_to<
|
||||
Allocator,sequenced_index_node_impl
|
||||
>::type::pointer pointer;
|
||||
typedef typename
|
||||
boost::detail::allocator::rebind_to<
|
||||
Allocator,sequenced_index_node_impl
|
||||
>::type::const_pointer const_pointer;
|
||||
|
||||
pointer& prior(){return prior_;}
|
||||
pointer prior()const{return prior_;}
|
||||
@ -136,25 +131,19 @@ private:
|
||||
|
||||
template<typename Super>
|
||||
struct sequenced_index_node_trampoline:
|
||||
prevent_eti<
|
||||
Super,
|
||||
sequenced_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
typename Super::allocator_type,
|
||||
char
|
||||
>::type
|
||||
>
|
||||
>::type
|
||||
sequenced_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
typename Super::allocator_type,
|
||||
char
|
||||
>::type
|
||||
>
|
||||
{
|
||||
typedef typename prevent_eti<
|
||||
Super,
|
||||
sequenced_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
typename Super::allocator_type,
|
||||
char
|
||||
>::type
|
||||
>
|
||||
>::type impl_type;
|
||||
typedef sequenced_index_node_impl<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
typename Super::allocator_type,
|
||||
char
|
||||
>::type
|
||||
> impl_type;
|
||||
};
|
||||
|
||||
template<typename Super>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_SEQ_INDEX_OPS_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_SEQ_INDEX_OPS_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -79,8 +79,7 @@ template<typename Node,typename Compare>
|
||||
void sequenced_index_collate(
|
||||
BOOST_DEDUCED_TYPENAME Node::impl_type* x,
|
||||
BOOST_DEDUCED_TYPENAME Node::impl_type* y,
|
||||
Compare comp
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(Node))
|
||||
Compare comp)
|
||||
{
|
||||
typedef typename Node::impl_type impl_type;
|
||||
typedef typename Node::impl_pointer impl_pointer;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2010 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_SERIALIZATION_VERSION_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_SERIALIZATION_VERSION_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -60,7 +60,6 @@ private:
|
||||
|
||||
} /* namespace multi_index */
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
namespace serialization {
|
||||
template<typename T>
|
||||
struct version<boost::multi_index::detail::serialization_version<T> >
|
||||
@ -68,7 +67,6 @@ struct version<boost::multi_index::detail::serialization_version<T> >
|
||||
BOOST_STATIC_CONSTANT(int,value=version<T>::value);
|
||||
};
|
||||
} /* namespace serialization */
|
||||
#endif
|
||||
|
||||
} /* namespace boost */
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_UINTPTR_TYPE_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_UINTPTR_TYPE_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_UNBOUNDED_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_UNBOUNDED_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -22,22 +22,6 @@ namespace multi_index{
|
||||
|
||||
/* dummy type and variable for use in ordered_index::range() */
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
/* The default branch actually works for MSVC 6.0, but seems like
|
||||
* this implementation of unbounded improves the performance of ordered
|
||||
* indices! This behavior is hard to explain and probably a test artifact,
|
||||
* but it does not hurt to have the workaround anyway.
|
||||
*/
|
||||
|
||||
namespace detail{struct unbounded_type{};}
|
||||
|
||||
namespace{
|
||||
|
||||
static detail::unbounded_type unbounded_obj=detail::unbounded_type();
|
||||
static detail::unbounded_type& unbounded=unbounded_obj;
|
||||
|
||||
} /* unnamed */
|
||||
#else
|
||||
/* ODR-abiding technique shown at the example attached to
|
||||
* http://lists.boost.org/Archives/boost/2006/07/108355.php
|
||||
*/
|
||||
@ -63,7 +47,6 @@ inline detail::unbounded_helper unbounded(detail::unbounded_helper)
|
||||
{
|
||||
return detail::unbounded_helper();
|
||||
}
|
||||
#endif
|
||||
|
||||
/* tags used in the implementation of range */
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_VALUE_COMPARE_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_VALUE_COMPARE_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_DETAIL_VARTEMPL_SUPPORT_HPP
|
||||
#define BOOST_MULTI_INDEX_DETAIL_VARTEMPL_SUPPORT_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_GLOBAL_FUN_HPP
|
||||
#define BOOST_MULTI_INDEX_GLOBAL_FUN_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -46,16 +46,6 @@ namespace detail{
|
||||
* arbitrary combinations of these (vg. T** or auto_ptr<T*>.)
|
||||
*/
|
||||
|
||||
/* NB. Some overloads of operator() have an extra dummy parameter int=0.
|
||||
* This disambiguator serves several purposes:
|
||||
* - Without it, MSVC++ 6.0 incorrectly regards some overloads as
|
||||
* specializations of a previous member function template.
|
||||
* - MSVC++ 6.0/7.0 seem to incorrectly treat some different memfuns
|
||||
* as if they have the same signature.
|
||||
* - If remove_const is broken due to lack of PTS, int=0 avoids the
|
||||
* declaration of memfuns with identical signature.
|
||||
*/
|
||||
|
||||
template<class Value,typename Type,Type (*PtrToFunction)(Value)>
|
||||
struct const_ref_global_fun_base
|
||||
{
|
||||
@ -90,7 +80,7 @@ struct const_ref_global_fun_base
|
||||
Type operator()(
|
||||
const reference_wrapper<
|
||||
typename remove_const<
|
||||
typename remove_reference<Value>::type>::type>& x,int=0)const
|
||||
typename remove_reference<Value>::type>::type>& x)const
|
||||
{
|
||||
return operator()(x.get());
|
||||
}
|
||||
@ -158,8 +148,7 @@ struct non_ref_global_fun_base
|
||||
}
|
||||
|
||||
Type operator()(
|
||||
const reference_wrapper<
|
||||
typename remove_const<Value>::type>& x,int=0)const
|
||||
const reference_wrapper<typename remove_const<Value>::type>& x)const
|
||||
{
|
||||
return operator()(x.get());
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_HASHED_INDEX_FWD_HPP
|
||||
#define BOOST_MULTI_INDEX_HASHED_INDEX_FWD_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -27,6 +27,22 @@ template<
|
||||
>
|
||||
class hashed_index;
|
||||
|
||||
template<
|
||||
typename KeyFromValue,typename Hash,typename Pred,
|
||||
typename SuperMeta,typename TagList,typename Category
|
||||
>
|
||||
bool operator==(
|
||||
const hashed_index<KeyFromValue,Hash,Pred,SuperMeta,TagList,Category>& x,
|
||||
const hashed_index<KeyFromValue,Hash,Pred,SuperMeta,TagList,Category>& y);
|
||||
|
||||
template<
|
||||
typename KeyFromValue,typename Hash,typename Pred,
|
||||
typename SuperMeta,typename TagList,typename Category
|
||||
>
|
||||
bool operator!=(
|
||||
const hashed_index<KeyFromValue,Hash,Pred,SuperMeta,TagList,Category>& x,
|
||||
const hashed_index<KeyFromValue,Hash,Pred,SuperMeta,TagList,Category>& y);
|
||||
|
||||
template<
|
||||
typename KeyFromValue,typename Hash,typename Pred,
|
||||
typename SuperMeta,typename TagList,typename Category
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_IDENTITY_HPP
|
||||
#define BOOST_MULTI_INDEX_IDENTITY_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -42,16 +42,6 @@ namespace detail{
|
||||
* arbitrary combinations of these (vg. Type** or auto_ptr<Type*>.)
|
||||
*/
|
||||
|
||||
/* NB. Some overloads of operator() have an extra dummy parameter int=0.
|
||||
* This disambiguator serves several purposes:
|
||||
* - Without it, MSVC++ 6.0 incorrectly regards some overloads as
|
||||
* specializations of a previous member function template.
|
||||
* - MSVC++ 6.0/7.0 seem to incorrectly treat some different memfuns
|
||||
* as if they have the same signature.
|
||||
* - If remove_const is broken due to lack of PTS, int=0 avoids the
|
||||
* declaration of memfuns with identical signature.
|
||||
*/
|
||||
|
||||
template<typename Type>
|
||||
struct const_identity_base
|
||||
{
|
||||
@ -81,7 +71,7 @@ struct const_identity_base
|
||||
}
|
||||
|
||||
Type& operator()(
|
||||
const reference_wrapper<typename remove_const<Type>::type>& x,int=0)const
|
||||
const reference_wrapper<typename remove_const<Type>::type>& x)const
|
||||
{
|
||||
return x.get();
|
||||
}
|
||||
@ -108,7 +98,7 @@ struct non_const_identity_base
|
||||
return operator()(*x);
|
||||
}
|
||||
|
||||
const Type& operator()(const Type& x,int=0)const
|
||||
const Type& operator()(const Type& x)const
|
||||
{
|
||||
return x;
|
||||
}
|
||||
@ -118,7 +108,7 @@ struct non_const_identity_base
|
||||
return x;
|
||||
}
|
||||
|
||||
const Type& operator()(const reference_wrapper<const Type>& x,int=0)const
|
||||
const Type& operator()(const reference_wrapper<const Type>& x)const
|
||||
{
|
||||
return x.get();
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_IDENTITY_FWD_HPP
|
||||
#define BOOST_MULTI_INDEX_IDENTITY_FWD_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_INDEXED_BY_HPP
|
||||
#define BOOST_MULTI_INDEX_INDEXED_BY_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -31,12 +31,8 @@
|
||||
*/
|
||||
|
||||
#if !defined(BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE)
|
||||
#if defined(BOOST_MSVC)&&(BOOST_MSVC<1300)
|
||||
#define BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE 5
|
||||
#else
|
||||
#define BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE<BOOST_MPL_LIMIT_VECTOR_SIZE
|
||||
#define BOOST_MULTI_INDEX_INDEXED_BY_SIZE \
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_KEY_EXTRACTORS_HPP
|
||||
#define BOOST_MULTI_INDEX_KEY_EXTRACTORS_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_MEM_FUN_HPP
|
||||
#define BOOST_MULTI_INDEX_MEM_FUN_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -112,6 +112,9 @@ struct mem_fun
|
||||
* news:microsoft.public.vc.language, 21st nov 2002,
|
||||
* http://groups.google.com/groups?
|
||||
* hl=en&lr=&ie=UTF-8&selm=ukwvg3O0BHA.1512%40tkmsftngp05
|
||||
*
|
||||
* MSVC++ 6.0 support has been dropped and [const_]mem_fun_explicit is
|
||||
* deprecated.
|
||||
*/
|
||||
|
||||
template<
|
||||
@ -183,28 +186,18 @@ struct mem_fun_explicit
|
||||
}
|
||||
};
|
||||
|
||||
/* BOOST_MULTI_INDEX_CONST_MEM_FUN and BOOST_MULTI_INDEX_MEM_FUN resolve to
|
||||
* [const_]mem_fun_explicit for MSVC++ 6.0 and to [const_]mem_fun otherwise.
|
||||
/* BOOST_MULTI_INDEX_CONST_MEM_FUN and BOOST_MULTI_INDEX_MEM_FUN used to
|
||||
* resolve to [const_]mem_fun_explicit for MSVC++ 6.0 and to
|
||||
* [const_]mem_fun otherwise. Support for this compiler having been dropped,
|
||||
* they are now just wrappers over [const_]mem_fun kept for backwards-
|
||||
* compatibility reasons.
|
||||
*/
|
||||
|
||||
#if defined(BOOST_MSVC)&&(BOOST_MSVC<1300)
|
||||
|
||||
#define BOOST_MULTI_INDEX_CONST_MEM_FUN(Class,Type,MemberFunName) \
|
||||
::boost::multi_index::const_mem_fun_explicit<\
|
||||
Class,Type,Type (Class::*)()const,&Class::MemberFunName >
|
||||
#define BOOST_MULTI_INDEX_MEM_FUN(Class,Type,MemberFunName) \
|
||||
::boost::multi_index::mem_fun_explicit<\
|
||||
Class,Type,Type (Class::*)(),&Class::MemberFunName >
|
||||
|
||||
#else
|
||||
|
||||
#define BOOST_MULTI_INDEX_CONST_MEM_FUN(Class,Type,MemberFunName) \
|
||||
::boost::multi_index::const_mem_fun< Class,Type,&Class::MemberFunName >
|
||||
#define BOOST_MULTI_INDEX_MEM_FUN(Class,Type,MemberFunName) \
|
||||
::boost::multi_index::mem_fun< Class,Type,&Class::MemberFunName >
|
||||
|
||||
#endif
|
||||
|
||||
} /* namespace multi_index */
|
||||
|
||||
} /* namespace boost */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_MEMBER_HPP
|
||||
#define BOOST_MULTI_INDEX_MEMBER_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -41,16 +41,6 @@ namespace detail{
|
||||
* arbitrary combinations of these (vg. T** or auto_ptr<T*>.)
|
||||
*/
|
||||
|
||||
/* NB. Some overloads of operator() have an extra dummy parameter int=0.
|
||||
* This disambiguator serves several purposes:
|
||||
* - Without it, MSVC++ 6.0 incorrectly regards some overloads as
|
||||
* specializations of a previous member function template.
|
||||
* - MSVC++ 6.0/7.0 seem to incorrectly treat some different memfuns
|
||||
* as if they have the same signature.
|
||||
* - If remove_const is broken due to lack of PTS, int=0 avoids the
|
||||
* declaration of memfuns with identical signature.
|
||||
*/
|
||||
|
||||
template<class Class,typename Type,Type Class::*PtrToMember>
|
||||
struct const_member_base
|
||||
{
|
||||
@ -80,7 +70,7 @@ struct const_member_base
|
||||
return operator()(x.get());
|
||||
}
|
||||
|
||||
Type& operator()(const reference_wrapper<Class>& x,int=0)const
|
||||
Type& operator()(const reference_wrapper<Class>& x)const
|
||||
{
|
||||
return operator()(x.get());
|
||||
}
|
||||
@ -105,7 +95,7 @@ struct non_const_member_base
|
||||
return operator()(*x);
|
||||
}
|
||||
|
||||
const Type& operator()(const Class& x,int=0)const
|
||||
const Type& operator()(const Class& x)const
|
||||
{
|
||||
return x.*PtrToMember;
|
||||
}
|
||||
@ -115,7 +105,7 @@ struct non_const_member_base
|
||||
return x.*PtrToMember;
|
||||
}
|
||||
|
||||
const Type& operator()(const reference_wrapper<const Class>& x,int=0)const
|
||||
const Type& operator()(const reference_wrapper<const Class>& x)const
|
||||
{
|
||||
return operator()(x.get());
|
||||
}
|
||||
@ -152,6 +142,9 @@ namespace detail{
|
||||
* Surprisingly enough, other compilers, like Intel C++ 7.0/7.1 and
|
||||
* Visual Age 6.0, have similar bugs. This replacement of member<>
|
||||
* can be used for them too.
|
||||
*
|
||||
* Support for such old compilers is dropped and
|
||||
* [non_]const_member_offset_base is deprecated.
|
||||
*/
|
||||
|
||||
template<class Class,typename Type,std::size_t OffsetOfMember>
|
||||
@ -186,7 +179,7 @@ struct const_member_offset_base
|
||||
return operator()(x.get());
|
||||
}
|
||||
|
||||
Type& operator()(const reference_wrapper<Class>& x,int=0)const
|
||||
Type& operator()(const reference_wrapper<Class>& x)const
|
||||
{
|
||||
return operator()(x.get());
|
||||
}
|
||||
@ -211,7 +204,7 @@ struct non_const_member_offset_base
|
||||
return operator()(*x);
|
||||
}
|
||||
|
||||
const Type& operator()(const Class& x,int=0)const
|
||||
const Type& operator()(const Class& x)const
|
||||
{
|
||||
return *static_cast<const Type*>(
|
||||
static_cast<const void*>(
|
||||
@ -226,7 +219,7 @@ struct non_const_member_offset_base
|
||||
static_cast<char*>(static_cast<void *>(&x))+OffsetOfMember));
|
||||
}
|
||||
|
||||
const Type& operator()(const reference_wrapper<const Class>& x,int=0)const
|
||||
const Type& operator()(const reference_wrapper<const Class>& x)const
|
||||
{
|
||||
return operator()(x.get());
|
||||
}
|
||||
|
@ -36,7 +36,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_ORDERED_INDEX_HPP
|
||||
#define BOOST_MULTI_INDEX_ORDERED_INDEX_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -58,7 +58,6 @@
|
||||
#include <boost/multi_index/detail/modify_key_adaptor.hpp>
|
||||
#include <boost/multi_index/detail/ord_index_node.hpp>
|
||||
#include <boost/multi_index/detail/ord_index_ops.hpp>
|
||||
#include <boost/multi_index/detail/safe_ctr_proxy.hpp>
|
||||
#include <boost/multi_index/detail/safe_mode.hpp>
|
||||
#include <boost/multi_index/detail/scope_guard.hpp>
|
||||
#include <boost/multi_index/detail/unbounded.hpp>
|
||||
@ -117,16 +116,9 @@ class ordered_index:
|
||||
BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS SuperMeta::type
|
||||
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
,public safe_ctr_proxy_impl<
|
||||
bidir_node_iterator<
|
||||
ordered_index_node<typename SuperMeta::type::node_type> >,
|
||||
ordered_index<KeyFromValue,Compare,SuperMeta,TagList,Category> >
|
||||
#else
|
||||
,public safe_mode::safe_container<
|
||||
ordered_index<KeyFromValue,Compare,SuperMeta,TagList,Category> >
|
||||
#endif
|
||||
#endif
|
||||
|
||||
{
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING)&&\
|
||||
@ -164,16 +156,9 @@ public:
|
||||
typedef typename allocator_type::const_reference const_reference;
|
||||
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
typedef safe_mode::safe_iterator<
|
||||
bidir_node_iterator<node_type>,
|
||||
safe_ctr_proxy<
|
||||
bidir_node_iterator<node_type> > > iterator;
|
||||
#else
|
||||
typedef safe_mode::safe_iterator<
|
||||
bidir_node_iterator<node_type>,
|
||||
ordered_index> iterator;
|
||||
#endif
|
||||
#else
|
||||
typedef bidir_node_iterator<node_type> iterator;
|
||||
#endif
|
||||
@ -213,13 +198,7 @@ protected:
|
||||
|
||||
private:
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
typedef safe_ctr_proxy_impl<
|
||||
bidir_node_iterator<node_type>,
|
||||
ordered_index> safe_super;
|
||||
#else
|
||||
typedef safe_mode::safe_container<ordered_index> safe_super;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef typename call_traits<
|
||||
@ -256,25 +235,37 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
allocator_type get_allocator()const
|
||||
allocator_type get_allocator()const BOOST_NOEXCEPT
|
||||
{
|
||||
return this->final().get_allocator();
|
||||
}
|
||||
|
||||
/* iterators */
|
||||
|
||||
iterator begin(){return make_iterator(leftmost());}
|
||||
const_iterator begin()const{return make_iterator(leftmost());}
|
||||
iterator end(){return make_iterator(header());}
|
||||
const_iterator end()const{return make_iterator(header());}
|
||||
reverse_iterator rbegin(){return make_reverse_iterator(end());}
|
||||
const_reverse_iterator rbegin()const{return make_reverse_iterator(end());}
|
||||
reverse_iterator rend(){return make_reverse_iterator(begin());}
|
||||
const_reverse_iterator rend()const{return make_reverse_iterator(begin());}
|
||||
const_iterator cbegin()const{return begin();}
|
||||
const_iterator cend()const{return end();}
|
||||
const_reverse_iterator crbegin()const{return rbegin();}
|
||||
const_reverse_iterator crend()const{return rend();}
|
||||
iterator
|
||||
begin()BOOST_NOEXCEPT{return make_iterator(leftmost());}
|
||||
const_iterator
|
||||
begin()const BOOST_NOEXCEPT{return make_iterator(leftmost());}
|
||||
iterator
|
||||
end()BOOST_NOEXCEPT{return make_iterator(header());}
|
||||
const_iterator
|
||||
end()const BOOST_NOEXCEPT{return make_iterator(header());}
|
||||
reverse_iterator
|
||||
rbegin()BOOST_NOEXCEPT{return make_reverse_iterator(end());}
|
||||
const_reverse_iterator
|
||||
rbegin()const BOOST_NOEXCEPT{return make_reverse_iterator(end());}
|
||||
reverse_iterator
|
||||
rend()BOOST_NOEXCEPT{return make_reverse_iterator(begin());}
|
||||
const_reverse_iterator
|
||||
rend()const BOOST_NOEXCEPT{return make_reverse_iterator(begin());}
|
||||
const_iterator
|
||||
cbegin()const BOOST_NOEXCEPT{return begin();}
|
||||
const_iterator
|
||||
cend()const BOOST_NOEXCEPT{return end();}
|
||||
const_reverse_iterator
|
||||
crbegin()const BOOST_NOEXCEPT{return rbegin();}
|
||||
const_reverse_iterator
|
||||
crend()const BOOST_NOEXCEPT{return rend();}
|
||||
|
||||
iterator iterator_to(const value_type& x)
|
||||
{
|
||||
@ -288,9 +279,9 @@ public:
|
||||
|
||||
/* capacity */
|
||||
|
||||
bool empty()const{return this->final_empty_();}
|
||||
size_type size()const{return this->final_size_();}
|
||||
size_type max_size()const{return this->final_max_size_();}
|
||||
bool empty()const BOOST_NOEXCEPT{return this->final_empty_();}
|
||||
size_type size()const BOOST_NOEXCEPT{return this->final_size_();}
|
||||
size_type max_size()const BOOST_NOEXCEPT{return this->final_max_size_();}
|
||||
|
||||
/* modifiers */
|
||||
|
||||
@ -431,7 +422,7 @@ public:
|
||||
}
|
||||
|
||||
template<typename Modifier,typename Rollback>
|
||||
bool modify(iterator position,Modifier mod,Rollback back)
|
||||
bool modify(iterator position,Modifier mod,Rollback back_)
|
||||
{
|
||||
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
|
||||
BOOST_MULTI_INDEX_CHECK_DEREFERENCEABLE_ITERATOR(position);
|
||||
@ -448,7 +439,7 @@ public:
|
||||
#endif
|
||||
|
||||
return this->final_modify_(
|
||||
mod,back,static_cast<final_node_type*>(position.get_node()));
|
||||
mod,back_,static_cast<final_node_type*>(position.get_node()));
|
||||
}
|
||||
|
||||
template<typename Modifier>
|
||||
@ -463,7 +454,7 @@ public:
|
||||
}
|
||||
|
||||
template<typename Modifier,typename Rollback>
|
||||
bool modify_key(iterator position,Modifier mod,Rollback back)
|
||||
bool modify_key(iterator position,Modifier mod,Rollback back_)
|
||||
{
|
||||
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
|
||||
BOOST_MULTI_INDEX_CHECK_DEREFERENCEABLE_ITERATOR(position);
|
||||
@ -472,7 +463,7 @@ public:
|
||||
return modify(
|
||||
position,
|
||||
modify_key_adaptor<Modifier,value_type,KeyFromValue>(mod,key),
|
||||
modify_key_adaptor<Rollback,value_type,KeyFromValue>(back,key));
|
||||
modify_key_adaptor<Rollback,value_type,KeyFromValue>(back_,key));
|
||||
}
|
||||
|
||||
void swap(ordered_index<KeyFromValue,Compare,SuperMeta,TagList,Category>& x)
|
||||
@ -482,7 +473,7 @@ public:
|
||||
this->final_swap_(x.final());
|
||||
}
|
||||
|
||||
void clear()
|
||||
void clear()BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_MULTI_INDEX_ORD_INDEX_CHECK_INVARIANT;
|
||||
this->final_clear_();
|
||||
@ -709,32 +700,35 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
}
|
||||
|
||||
template<typename Variant>
|
||||
node_type* insert_(value_param_type v,node_type* x,Variant variant)
|
||||
final_node_type* insert_(
|
||||
value_param_type v,final_node_type*& x,Variant variant)
|
||||
{
|
||||
link_info inf;
|
||||
if(!link_point(key(v),inf,Category())){
|
||||
return node_type::from_impl(inf.pos);
|
||||
return static_cast<final_node_type*>(node_type::from_impl(inf.pos));
|
||||
}
|
||||
|
||||
node_type* res=static_cast<node_type*>(super::insert_(v,x,variant));
|
||||
final_node_type* res=super::insert_(v,x,variant);
|
||||
if(res==x){
|
||||
node_impl_type::link(x->impl(),inf.side,inf.pos,header()->impl());
|
||||
node_impl_type::link(
|
||||
static_cast<node_type*>(x)->impl(),inf.side,inf.pos,header()->impl());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
template<typename Variant>
|
||||
node_type* insert_(
|
||||
value_param_type v,node_type* position,node_type* x,Variant variant)
|
||||
final_node_type* insert_(
|
||||
value_param_type v,node_type* position,final_node_type*& x,Variant variant)
|
||||
{
|
||||
link_info inf;
|
||||
if(!hinted_link_point(key(v),position,inf,Category())){
|
||||
return node_type::from_impl(inf.pos);
|
||||
return static_cast<final_node_type*>(node_type::from_impl(inf.pos));
|
||||
}
|
||||
|
||||
node_type* res=static_cast<node_type*>(super::insert_(v,position,x,variant));
|
||||
final_node_type* res=super::insert_(v,position,x,variant);
|
||||
if(res==x){
|
||||
node_impl_type::link(x->impl(),inf.side,inf.pos,header()->impl());
|
||||
node_impl_type::link(
|
||||
static_cast<node_type*>(x)->impl(),inf.side,inf.pos,header()->impl());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_ORDERED_INDEX_FWD_HPP
|
||||
#define BOOST_MULTI_INDEX_ORDERED_INDEX_FWD_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_RANDOM_ACCESS_INDEX_HPP
|
||||
#define BOOST_MULTI_INDEX_RANDOM_ACCESS_INDEX_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -32,7 +32,6 @@
|
||||
#include <boost/multi_index/detail/rnd_index_node.hpp>
|
||||
#include <boost/multi_index/detail/rnd_index_ops.hpp>
|
||||
#include <boost/multi_index/detail/rnd_index_ptr_array.hpp>
|
||||
#include <boost/multi_index/detail/safe_ctr_proxy.hpp>
|
||||
#include <boost/multi_index/detail/safe_mode.hpp>
|
||||
#include <boost/multi_index/detail/scope_guard.hpp>
|
||||
#include <boost/multi_index/detail/vartempl_support.hpp>
|
||||
@ -81,16 +80,9 @@ class random_access_index:
|
||||
BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS SuperMeta::type
|
||||
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
,public safe_ctr_proxy_impl<
|
||||
rnd_node_iterator<
|
||||
random_access_index_node<typename SuperMeta::type::node_type> >,
|
||||
random_access_index<SuperMeta,TagList> >
|
||||
#else
|
||||
,public safe_mode::safe_container<
|
||||
random_access_index<SuperMeta,TagList> >
|
||||
#endif
|
||||
#endif
|
||||
|
||||
{
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING)&&\
|
||||
@ -125,16 +117,9 @@ public:
|
||||
typedef typename allocator_type::const_reference const_reference;
|
||||
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
typedef safe_mode::safe_iterator<
|
||||
rnd_node_iterator<node_type>,
|
||||
safe_ctr_proxy<
|
||||
rnd_node_iterator<node_type> > > iterator;
|
||||
#else
|
||||
typedef safe_mode::safe_iterator<
|
||||
rnd_node_iterator<node_type>,
|
||||
random_access_index> iterator;
|
||||
#endif
|
||||
#else
|
||||
typedef rnd_node_iterator<node_type> iterator;
|
||||
#endif
|
||||
@ -174,14 +159,8 @@ protected:
|
||||
|
||||
private:
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
typedef safe_ctr_proxy_impl<
|
||||
rnd_node_iterator<node_type>,
|
||||
random_access_index> safe_super;
|
||||
#else
|
||||
typedef safe_mode::safe_container<
|
||||
random_access_index> safe_super;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef typename call_traits<
|
||||
@ -236,27 +215,37 @@ public:
|
||||
for(size_type i=0;i<n;++i)push_back(value);
|
||||
}
|
||||
|
||||
allocator_type get_allocator()const
|
||||
allocator_type get_allocator()const BOOST_NOEXCEPT
|
||||
{
|
||||
return this->final().get_allocator();
|
||||
}
|
||||
|
||||
/* iterators */
|
||||
|
||||
iterator begin()
|
||||
iterator begin()BOOST_NOEXCEPT
|
||||
{return make_iterator(node_type::from_impl(*ptrs.begin()));}
|
||||
const_iterator begin()const
|
||||
const_iterator begin()const BOOST_NOEXCEPT
|
||||
{return make_iterator(node_type::from_impl(*ptrs.begin()));}
|
||||
iterator end(){return make_iterator(header());}
|
||||
const_iterator end()const{return make_iterator(header());}
|
||||
reverse_iterator rbegin(){return make_reverse_iterator(end());}
|
||||
const_reverse_iterator rbegin()const{return make_reverse_iterator(end());}
|
||||
reverse_iterator rend(){return make_reverse_iterator(begin());}
|
||||
const_reverse_iterator rend()const{return make_reverse_iterator(begin());}
|
||||
const_iterator cbegin()const{return begin();}
|
||||
const_iterator cend()const{return end();}
|
||||
const_reverse_iterator crbegin()const{return rbegin();}
|
||||
const_reverse_iterator crend()const{return rend();}
|
||||
iterator
|
||||
end()BOOST_NOEXCEPT{return make_iterator(header());}
|
||||
const_iterator
|
||||
end()const BOOST_NOEXCEPT{return make_iterator(header());}
|
||||
reverse_iterator
|
||||
rbegin()BOOST_NOEXCEPT{return make_reverse_iterator(end());}
|
||||
const_reverse_iterator
|
||||
rbegin()const BOOST_NOEXCEPT{return make_reverse_iterator(end());}
|
||||
reverse_iterator
|
||||
rend()BOOST_NOEXCEPT{return make_reverse_iterator(begin());}
|
||||
const_reverse_iterator
|
||||
rend()const BOOST_NOEXCEPT{return make_reverse_iterator(begin());}
|
||||
const_iterator
|
||||
cbegin()const BOOST_NOEXCEPT{return begin();}
|
||||
const_iterator
|
||||
cend()const BOOST_NOEXCEPT{return end();}
|
||||
const_reverse_iterator
|
||||
crbegin()const BOOST_NOEXCEPT{return rbegin();}
|
||||
const_reverse_iterator
|
||||
crend()const BOOST_NOEXCEPT{return rend();}
|
||||
|
||||
iterator iterator_to(const value_type& x)
|
||||
{
|
||||
@ -270,10 +259,10 @@ public:
|
||||
|
||||
/* capacity */
|
||||
|
||||
bool empty()const{return this->final_empty_();}
|
||||
size_type size()const{return this->final_size_();}
|
||||
size_type max_size()const{return this->final_max_size_();}
|
||||
size_type capacity()const{return ptrs.capacity();}
|
||||
bool empty()const BOOST_NOEXCEPT{return this->final_empty_();}
|
||||
size_type size()const BOOST_NOEXCEPT{return this->final_size_();}
|
||||
size_type max_size()const BOOST_NOEXCEPT{return this->final_max_size_();}
|
||||
size_type capacity()const BOOST_NOEXCEPT{return ptrs.capacity();}
|
||||
|
||||
void reserve(size_type n)
|
||||
{
|
||||
@ -467,7 +456,7 @@ public:
|
||||
}
|
||||
|
||||
template<typename Modifier,typename Rollback>
|
||||
bool modify(iterator position,Modifier mod,Rollback back)
|
||||
bool modify(iterator position,Modifier mod,Rollback back_)
|
||||
{
|
||||
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
|
||||
BOOST_MULTI_INDEX_CHECK_DEREFERENCEABLE_ITERATOR(position);
|
||||
@ -484,7 +473,7 @@ public:
|
||||
#endif
|
||||
|
||||
return this->final_modify_(
|
||||
mod,back,static_cast<final_node_type*>(position.get_node()));
|
||||
mod,back_,static_cast<final_node_type*>(position.get_node()));
|
||||
}
|
||||
|
||||
void swap(random_access_index<SuperMeta,TagList>& x)
|
||||
@ -494,7 +483,7 @@ public:
|
||||
this->final_swap_(x.final());
|
||||
}
|
||||
|
||||
void clear()
|
||||
void clear()BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_MULTI_INDEX_RND_INDEX_CHECK_INVARIANT;
|
||||
this->final_clear_();
|
||||
@ -665,7 +654,7 @@ public:
|
||||
get_allocator(),ptrs,comp);
|
||||
}
|
||||
|
||||
void reverse()
|
||||
void reverse()BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_MULTI_INDEX_RND_INDEX_CHECK_INVARIANT;
|
||||
node_impl_type::reverse(ptrs.begin(),ptrs.end());
|
||||
@ -781,22 +770,22 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
}
|
||||
|
||||
template<typename Variant>
|
||||
node_type* insert_(value_param_type v,node_type* x,Variant variant)
|
||||
final_node_type* insert_(
|
||||
value_param_type v,final_node_type*& x,Variant variant)
|
||||
{
|
||||
ptrs.room_for_one();
|
||||
node_type* res=static_cast<node_type*>(super::insert_(v,x,variant));
|
||||
if(res==x)ptrs.push_back(x->impl());
|
||||
final_node_type* res=super::insert_(v,x,variant);
|
||||
if(res==x)ptrs.push_back(static_cast<node_type*>(x)->impl());
|
||||
return res;
|
||||
}
|
||||
|
||||
template<typename Variant>
|
||||
node_type* insert_(
|
||||
value_param_type v,node_type* position,node_type* x,Variant variant)
|
||||
final_node_type* insert_(
|
||||
value_param_type v,node_type* position,final_node_type*& x,Variant variant)
|
||||
{
|
||||
ptrs.room_for_one();
|
||||
node_type* res=
|
||||
static_cast<node_type*>(super::insert_(v,position,x,variant));
|
||||
if(res==x)ptrs.push_back(x->impl());
|
||||
final_node_type* res=super::insert_(v,position,x,variant);
|
||||
if(res==x)ptrs.push_back(static_cast<node_type*>(x)->impl());
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_RANDOM_ACCESS_INDEX_FWD_HPP
|
||||
#define BOOST_MULTI_INDEX_RANDOM_ACCESS_INDEX_FWD_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_SAFE_MODE_ERRORS_HPP
|
||||
#define BOOST_MULTI_INDEX_SAFE_MODE_ERRORS_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_SEQUENCED_INDEX_HPP
|
||||
#define BOOST_MULTI_INDEX_SEQUENCED_INDEX_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -29,7 +29,6 @@
|
||||
#include <boost/multi_index/detail/bidir_node_iterator.hpp>
|
||||
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
|
||||
#include <boost/multi_index/detail/index_node_base.hpp>
|
||||
#include <boost/multi_index/detail/safe_ctr_proxy.hpp>
|
||||
#include <boost/multi_index/detail/safe_mode.hpp>
|
||||
#include <boost/multi_index/detail/scope_guard.hpp>
|
||||
#include <boost/multi_index/detail/seq_index_node.hpp>
|
||||
@ -75,16 +74,9 @@ class sequenced_index:
|
||||
BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS SuperMeta::type
|
||||
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
,public safe_ctr_proxy_impl<
|
||||
bidir_node_iterator<
|
||||
sequenced_index_node<typename SuperMeta::type::node_type> >,
|
||||
sequenced_index<SuperMeta,TagList> >
|
||||
#else
|
||||
,public safe_mode::safe_container<
|
||||
sequenced_index<SuperMeta,TagList> >
|
||||
#endif
|
||||
#endif
|
||||
|
||||
{
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING)&&\
|
||||
@ -116,16 +108,9 @@ public:
|
||||
typedef typename allocator_type::const_reference const_reference;
|
||||
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
typedef safe_mode::safe_iterator<
|
||||
bidir_node_iterator<node_type>,
|
||||
safe_ctr_proxy<
|
||||
bidir_node_iterator<node_type> > > iterator;
|
||||
#else
|
||||
typedef safe_mode::safe_iterator<
|
||||
bidir_node_iterator<node_type>,
|
||||
sequenced_index> iterator;
|
||||
#endif
|
||||
#else
|
||||
typedef bidir_node_iterator<node_type> iterator;
|
||||
#endif
|
||||
@ -165,14 +150,8 @@ protected:
|
||||
|
||||
private:
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
typedef safe_ctr_proxy_impl<
|
||||
bidir_node_iterator<node_type>,
|
||||
sequenced_index> safe_super;
|
||||
#else
|
||||
typedef safe_mode::safe_container<
|
||||
sequenced_index> safe_super;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef typename call_traits<value_type>::param_type value_param_type;
|
||||
@ -226,27 +205,37 @@ public:
|
||||
for(size_type i=0;i<n;++i)push_back(value);
|
||||
}
|
||||
|
||||
allocator_type get_allocator()const
|
||||
allocator_type get_allocator()const BOOST_NOEXCEPT
|
||||
{
|
||||
return this->final().get_allocator();
|
||||
}
|
||||
|
||||
/* iterators */
|
||||
|
||||
iterator begin()
|
||||
iterator begin()BOOST_NOEXCEPT
|
||||
{return make_iterator(node_type::from_impl(header()->next()));}
|
||||
const_iterator begin()const
|
||||
const_iterator begin()const BOOST_NOEXCEPT
|
||||
{return make_iterator(node_type::from_impl(header()->next()));}
|
||||
iterator end(){return make_iterator(header());}
|
||||
const_iterator end()const{return make_iterator(header());}
|
||||
reverse_iterator rbegin(){return make_reverse_iterator(end());}
|
||||
const_reverse_iterator rbegin()const{return make_reverse_iterator(end());}
|
||||
reverse_iterator rend(){return make_reverse_iterator(begin());}
|
||||
const_reverse_iterator rend()const{return make_reverse_iterator(begin());}
|
||||
const_iterator cbegin()const{return begin();}
|
||||
const_iterator cend()const{return end();}
|
||||
const_reverse_iterator crbegin()const{return rbegin();}
|
||||
const_reverse_iterator crend()const{return rend();}
|
||||
iterator
|
||||
end()BOOST_NOEXCEPT{return make_iterator(header());}
|
||||
const_iterator
|
||||
end()const BOOST_NOEXCEPT{return make_iterator(header());}
|
||||
reverse_iterator
|
||||
rbegin()BOOST_NOEXCEPT{return make_reverse_iterator(end());}
|
||||
const_reverse_iterator
|
||||
rbegin()const BOOST_NOEXCEPT{return make_reverse_iterator(end());}
|
||||
reverse_iterator
|
||||
rend()BOOST_NOEXCEPT{return make_reverse_iterator(begin());}
|
||||
const_reverse_iterator
|
||||
rend()const BOOST_NOEXCEPT{return make_reverse_iterator(begin());}
|
||||
const_iterator
|
||||
cbegin()const BOOST_NOEXCEPT{return begin();}
|
||||
const_iterator
|
||||
cend()const BOOST_NOEXCEPT{return end();}
|
||||
const_reverse_iterator
|
||||
crbegin()const BOOST_NOEXCEPT{return rbegin();}
|
||||
const_reverse_iterator
|
||||
crend()const BOOST_NOEXCEPT{return rend();}
|
||||
|
||||
iterator iterator_to(const value_type& x)
|
||||
{
|
||||
@ -260,9 +249,9 @@ public:
|
||||
|
||||
/* capacity */
|
||||
|
||||
bool empty()const{return this->final_empty_();}
|
||||
size_type size()const{return this->final_size_();}
|
||||
size_type max_size()const{return this->final_max_size_();}
|
||||
bool empty()const BOOST_NOEXCEPT{return this->final_empty_();}
|
||||
size_type size()const BOOST_NOEXCEPT{return this->final_size_();}
|
||||
size_type max_size()const BOOST_NOEXCEPT{return this->final_max_size_();}
|
||||
|
||||
void resize(size_type n)
|
||||
{
|
||||
@ -422,7 +411,7 @@ public:
|
||||
}
|
||||
|
||||
template<typename Modifier,typename Rollback>
|
||||
bool modify(iterator position,Modifier mod,Rollback back)
|
||||
bool modify(iterator position,Modifier mod,Rollback back_)
|
||||
{
|
||||
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
|
||||
BOOST_MULTI_INDEX_CHECK_DEREFERENCEABLE_ITERATOR(position);
|
||||
@ -439,7 +428,7 @@ public:
|
||||
#endif
|
||||
|
||||
return this->final_modify_(
|
||||
mod,back,static_cast<final_node_type*>(position.get_node()));
|
||||
mod,back_,static_cast<final_node_type*>(position.get_node()));
|
||||
}
|
||||
|
||||
void swap(sequenced_index<SuperMeta,TagList>& x)
|
||||
@ -449,7 +438,7 @@ public:
|
||||
this->final_swap_(x.final());
|
||||
}
|
||||
|
||||
void clear()
|
||||
void clear()BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_MULTI_INDEX_SEQ_INDEX_CHECK_INVARIANT;
|
||||
this->final_clear_();
|
||||
@ -571,7 +560,7 @@ public:
|
||||
sequenced_index_sort(header(),comp);
|
||||
}
|
||||
|
||||
void reverse()
|
||||
void reverse()BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_MULTI_INDEX_SEQ_INDEX_CHECK_INVARIANT;
|
||||
node_impl_type::reverse(header()->impl());
|
||||
@ -679,20 +668,20 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
}
|
||||
|
||||
template<typename Variant>
|
||||
node_type* insert_(value_param_type v,node_type* x,Variant variant)
|
||||
final_node_type* insert_(
|
||||
value_param_type v,final_node_type*& x,Variant variant)
|
||||
{
|
||||
node_type* res=static_cast<node_type*>(super::insert_(v,x,variant));
|
||||
if(res==x)link(x);
|
||||
final_node_type* res=super::insert_(v,x,variant);
|
||||
if(res==x)link(static_cast<node_type*>(x));
|
||||
return res;
|
||||
}
|
||||
|
||||
template<typename Variant>
|
||||
node_type* insert_(
|
||||
value_param_type v,node_type* position,node_type* x,Variant variant)
|
||||
final_node_type* insert_(
|
||||
value_param_type v,node_type* position,final_node_type*& x,Variant variant)
|
||||
{
|
||||
node_type* res=
|
||||
static_cast<node_type*>(super::insert_(v,position,x,variant));
|
||||
if(res==x)link(x);
|
||||
final_node_type* res=super::insert_(v,position,x,variant);
|
||||
if(res==x)link(static_cast<node_type*>(x));
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_SEQUENCED_INDEX_FWD_HPP
|
||||
#define BOOST_MULTI_INDEX_SEQUENCED_INDEX_FWD_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_TAG_HPP
|
||||
#define BOOST_MULTI_INDEX_TAG_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -34,12 +34,8 @@
|
||||
*/
|
||||
|
||||
#if !defined(BOOST_MULTI_INDEX_LIMIT_TAG_SIZE)
|
||||
#if defined(BOOST_MSVC)&&(BOOST_MSVC<1300)
|
||||
#define BOOST_MULTI_INDEX_LIMIT_TAG_SIZE 3
|
||||
#else
|
||||
#define BOOST_MULTI_INDEX_LIMIT_TAG_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if BOOST_MULTI_INDEX_LIMIT_TAG_SIZE<BOOST_MPL_LIMIT_VECTOR_SIZE
|
||||
#define BOOST_MULTI_INDEX_TAG_SIZE BOOST_MULTI_INDEX_LIMIT_TAG_SIZE
|
||||
|
@ -11,7 +11,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_HPP
|
||||
#define BOOST_MULTI_INDEX_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
#include <boost/multi_index/detail/header_holder.hpp>
|
||||
#include <boost/multi_index/detail/has_tag.hpp>
|
||||
#include <boost/multi_index/detail/no_duplicate_tags.hpp>
|
||||
#include <boost/multi_index/detail/prevent_eti.hpp>
|
||||
#include <boost/multi_index/detail/safe_mode.hpp>
|
||||
#include <boost/multi_index/detail/scope_guard.hpp>
|
||||
#include <boost/multi_index/detail/vartempl_support.hpp>
|
||||
@ -90,13 +89,10 @@ class multi_index_container:
|
||||
Value,IndexSpecifierList,Allocator>::type
|
||||
>::type>,
|
||||
BOOST_MULTI_INDEX_PRIVATE_IF_MEMBER_TEMPLATE_FRIENDS detail::header_holder<
|
||||
typename detail::prevent_eti<
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
typename boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
typename detail::multi_index_node_type<
|
||||
Value,IndexSpecifierList,Allocator>::type
|
||||
>::type
|
||||
typename detail::multi_index_node_type<
|
||||
Value,IndexSpecifierList,Allocator>::type
|
||||
>::type::pointer,
|
||||
multi_index_container<Value,IndexSpecifierList,Allocator> >,
|
||||
public detail::multi_index_base_type<
|
||||
@ -125,52 +121,25 @@ private:
|
||||
Value,IndexSpecifierList,Allocator>::type super;
|
||||
typedef typename
|
||||
boost::detail::allocator::rebind_to<
|
||||
Allocator,
|
||||
typename super::node_type
|
||||
Allocator,
|
||||
typename super::node_type
|
||||
>::type node_allocator;
|
||||
typedef ::boost::base_from_member<
|
||||
node_allocator> bfm_allocator;
|
||||
typedef detail::header_holder<
|
||||
typename detail::prevent_eti<
|
||||
Allocator,
|
||||
node_allocator
|
||||
>::type::pointer,
|
||||
typename node_allocator::pointer,
|
||||
multi_index_container> bfm_header;
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
/* see definition of index_type_list below */
|
||||
typedef typename super::index_type_list super_index_type_list;
|
||||
#endif
|
||||
|
||||
public:
|
||||
/* All types are inherited from super, a few are explicitly
|
||||
* brought forward here to save us some typename's.
|
||||
*/
|
||||
|
||||
typedef typename super::ctor_args_list ctor_args_list;
|
||||
typedef IndexSpecifierList index_specifier_type_list;
|
||||
typedef typename super::ctor_args_list ctor_args_list;
|
||||
typedef IndexSpecifierList index_specifier_type_list;
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
/* MSVC++ 6.0 chokes on moderately long index lists (around 6 indices
|
||||
* or more), with errors ranging from corrupt exes to duplicate
|
||||
* comdats. The following type hiding hack alleviates this condition;
|
||||
* best results combined with type hiding of the indexed_by construct
|
||||
* itself, as explained in the "Compiler specifics" section of
|
||||
* the documentation.
|
||||
*/
|
||||
|
||||
struct index_type_list:super_index_type_list
|
||||
{
|
||||
typedef index_type_list type;
|
||||
typedef typename super_index_type_list::back back;
|
||||
typedef mpl::v_iter<type,0> begin;
|
||||
typedef mpl::v_iter<
|
||||
type,
|
||||
mpl::size<super_index_type_list>::value> end;
|
||||
};
|
||||
#else
|
||||
typedef typename super::index_type_list index_type_list;
|
||||
#endif
|
||||
|
||||
typedef typename super::iterator_type_list iterator_type_list;
|
||||
typedef typename super::const_iterator_type_list const_iterator_type_list;
|
||||
@ -375,7 +344,7 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
allocator_type get_allocator()const
|
||||
allocator_type get_allocator()const BOOST_NOEXCEPT
|
||||
{
|
||||
return allocator_type(bfm_allocator::member);
|
||||
}
|
||||
@ -391,15 +360,14 @@ public:
|
||||
};
|
||||
|
||||
template<int N>
|
||||
typename nth_index<N>::type& get(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int,N))
|
||||
typename nth_index<N>::type& get()BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_STATIC_ASSERT(N>=0&&N<mpl::size<index_type_list>::type::value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<int N>
|
||||
const typename nth_index<N>::type& get(
|
||||
BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int,N))const
|
||||
const typename nth_index<N>::type& get()const BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_STATIC_ASSERT(N>=0&&N<mpl::size<index_type_list>::type::value);
|
||||
return *this;
|
||||
@ -425,14 +393,13 @@ public:
|
||||
};
|
||||
|
||||
template<typename Tag>
|
||||
typename index<Tag>::type& get(BOOST_EXPLICIT_TEMPLATE_TYPE(Tag))
|
||||
typename index<Tag>::type& get()BOOST_NOEXCEPT
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename Tag>
|
||||
const typename index<Tag>::type& get(
|
||||
BOOST_EXPLICIT_TEMPLATE_TYPE(Tag))const
|
||||
const typename index<Tag>::type& get()const BOOST_NOEXCEPT
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
@ -454,11 +421,9 @@ public:
|
||||
};
|
||||
|
||||
template<int N,typename IteratorType>
|
||||
typename nth_index_iterator<N>::type project(
|
||||
IteratorType it
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int,N))
|
||||
typename nth_index_iterator<N>::type project(IteratorType it)
|
||||
{
|
||||
typedef typename nth_index<N>::type index;
|
||||
typedef typename nth_index<N>::type index_type;
|
||||
|
||||
#if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* fails in Sun C++ 5.7 */
|
||||
BOOST_STATIC_ASSERT(
|
||||
@ -469,15 +434,13 @@ public:
|
||||
BOOST_MULTI_INDEX_CHECK_IS_OWNER(
|
||||
it,static_cast<typename IteratorType::container_type&>(*this));
|
||||
|
||||
return index::make_iterator(static_cast<node_type*>(it.get_node()));
|
||||
return index_type::make_iterator(static_cast<node_type*>(it.get_node()));
|
||||
}
|
||||
|
||||
template<int N,typename IteratorType>
|
||||
typename nth_index_const_iterator<N>::type project(
|
||||
IteratorType it
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int,N))const
|
||||
typename nth_index_const_iterator<N>::type project(IteratorType it)const
|
||||
{
|
||||
typedef typename nth_index<N>::type index;
|
||||
typedef typename nth_index<N>::type index_type;
|
||||
|
||||
#if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* fails in Sun C++ 5.7 */
|
||||
BOOST_STATIC_ASSERT((
|
||||
@ -488,7 +451,7 @@ public:
|
||||
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(it);
|
||||
BOOST_MULTI_INDEX_CHECK_IS_OWNER(
|
||||
it,static_cast<const typename IteratorType::container_type&>(*this));
|
||||
return index::make_iterator(static_cast<node_type*>(it.get_node()));
|
||||
return index_type::make_iterator(static_cast<node_type*>(it.get_node()));
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -508,11 +471,9 @@ public:
|
||||
};
|
||||
|
||||
template<typename Tag,typename IteratorType>
|
||||
typename index_iterator<Tag>::type project(
|
||||
IteratorType it
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(Tag))
|
||||
typename index_iterator<Tag>::type project(IteratorType it)
|
||||
{
|
||||
typedef typename index<Tag>::type index;
|
||||
typedef typename index<Tag>::type index_type;
|
||||
|
||||
#if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* fails in Sun C++ 5.7 */
|
||||
BOOST_STATIC_ASSERT(
|
||||
@ -522,15 +483,13 @@ public:
|
||||
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(it);
|
||||
BOOST_MULTI_INDEX_CHECK_IS_OWNER(
|
||||
it,static_cast<typename IteratorType::container_type&>(*this));
|
||||
return index::make_iterator(static_cast<node_type*>(it.get_node()));
|
||||
return index_type::make_iterator(static_cast<node_type*>(it.get_node()));
|
||||
}
|
||||
|
||||
template<typename Tag,typename IteratorType>
|
||||
typename index_const_iterator<Tag>::type project(
|
||||
IteratorType it
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(Tag))const
|
||||
typename index_const_iterator<Tag>::type project(IteratorType it)const
|
||||
{
|
||||
typedef typename index<Tag>::type index;
|
||||
typedef typename index<Tag>::type index_type;
|
||||
|
||||
#if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* fails in Sun C++ 5.7 */
|
||||
BOOST_STATIC_ASSERT((
|
||||
@ -541,7 +500,7 @@ public:
|
||||
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(it);
|
||||
BOOST_MULTI_INDEX_CHECK_IS_OWNER(
|
||||
it,static_cast<const typename IteratorType::container_type&>(*this));
|
||||
return index::make_iterator(static_cast<node_type*>(it.get_node()));
|
||||
return index_type::make_iterator(static_cast<node_type*>(it.get_node()));
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -595,23 +554,15 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
template<typename Variant>
|
||||
std::pair<node_type*,bool> insert_(const Value& v,Variant variant)
|
||||
{
|
||||
node_type* x=allocate_node();
|
||||
BOOST_TRY{
|
||||
node_type* res=super::insert_(v,x,variant);
|
||||
if(res==x){
|
||||
++node_count;
|
||||
return std::pair<node_type*,bool>(res,true);
|
||||
}
|
||||
else{
|
||||
deallocate_node(x);
|
||||
return std::pair<node_type*,bool>(res,false);
|
||||
}
|
||||
node_type* x=0;
|
||||
node_type* res=super::insert_(v,x,variant);
|
||||
if(res==x){
|
||||
++node_count;
|
||||
return std::pair<node_type*,bool>(res,true);
|
||||
}
|
||||
BOOST_CATCH(...){
|
||||
deallocate_node(x);
|
||||
BOOST_RETHROW;
|
||||
else{
|
||||
return std::pair<node_type*,bool>(res,false);
|
||||
}
|
||||
BOOST_CATCH_END
|
||||
}
|
||||
|
||||
std::pair<node_type*,bool> insert_(const Value& v)
|
||||
@ -702,23 +653,15 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
std::pair<node_type*,bool> insert_(
|
||||
const Value& v,node_type* position,Variant variant)
|
||||
{
|
||||
node_type* x=allocate_node();
|
||||
BOOST_TRY{
|
||||
node_type* res=super::insert_(v,position,x,variant);
|
||||
if(res==x){
|
||||
++node_count;
|
||||
return std::pair<node_type*,bool>(res,true);
|
||||
}
|
||||
else{
|
||||
deallocate_node(x);
|
||||
return std::pair<node_type*,bool>(res,false);
|
||||
}
|
||||
node_type* x=0;
|
||||
node_type* res=super::insert_(v,position,x,variant);
|
||||
if(res==x){
|
||||
++node_count;
|
||||
return std::pair<node_type*,bool>(res,true);
|
||||
}
|
||||
BOOST_CATCH(...){
|
||||
deallocate_node(x);
|
||||
BOOST_RETHROW;
|
||||
else{
|
||||
return std::pair<node_type*,bool>(res,false);
|
||||
}
|
||||
BOOST_CATCH_END
|
||||
}
|
||||
|
||||
std::pair<node_type*,bool> insert_(const Value& v,node_type* position)
|
||||
@ -886,7 +829,7 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
}
|
||||
|
||||
template<typename Modifier,typename Rollback>
|
||||
bool modify_(Modifier& mod,Rollback& back,node_type* x)
|
||||
bool modify_(Modifier& mod,Rollback& back_,node_type* x)
|
||||
{
|
||||
mod(const_cast<value_type&>(x->value()));
|
||||
|
||||
@ -896,7 +839,7 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
}
|
||||
BOOST_CATCH(...){
|
||||
BOOST_TRY{
|
||||
back(const_cast<value_type&>(x->value()));
|
||||
back_(const_cast<value_type&>(x->value()));
|
||||
BOOST_RETHROW;
|
||||
}
|
||||
BOOST_CATCH(...){
|
||||
@ -909,7 +852,7 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
|
||||
BOOST_TRY{
|
||||
if(!b){
|
||||
back(const_cast<value_type&>(x->value()));
|
||||
back_(const_cast<value_type&>(x->value()));
|
||||
return false;
|
||||
}
|
||||
else return true;
|
||||
@ -934,17 +877,10 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
template<class Archive>
|
||||
void save(Archive& ar,const unsigned int version)const
|
||||
{
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
const serialization::collection_size_type s(size_());
|
||||
const detail::serialization_version<value_type> value_version;
|
||||
ar<<serialization::make_nvp("count",s);
|
||||
ar<<serialization::make_nvp("value_version",value_version);
|
||||
#else
|
||||
const std::size_t s=size_();
|
||||
const unsigned int value_version=0;
|
||||
ar<<serialization::make_nvp("count",s);
|
||||
#endif
|
||||
|
||||
index_saver_type sm(bfm_allocator::member,s);
|
||||
|
||||
@ -964,8 +900,6 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
BOOST_MULTI_INDEX_CHECK_INVARIANT;
|
||||
|
||||
clear_();
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
serialization::collection_size_type s;
|
||||
detail::serialization_version<value_type> value_version;
|
||||
if(version<1){
|
||||
@ -982,11 +916,6 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
else{
|
||||
ar>>serialization::make_nvp("value_version",value_version);
|
||||
}
|
||||
#else
|
||||
std::size_t s;
|
||||
unsigned int value_version=0;
|
||||
ar>>serialization::make_nvp("count",s);
|
||||
#endif
|
||||
|
||||
index_loader_type lm(bfm_allocator::member,s);
|
||||
|
||||
@ -1050,8 +979,7 @@ template<int N,typename Value,typename IndexSpecifierList,typename Allocator>
|
||||
typename nth_index<
|
||||
multi_index_container<Value,IndexSpecifierList,Allocator>,N>::type&
|
||||
get(
|
||||
multi_index_container<Value,IndexSpecifierList,Allocator>& m
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int,N))
|
||||
multi_index_container<Value,IndexSpecifierList,Allocator>& m)BOOST_NOEXCEPT
|
||||
{
|
||||
typedef multi_index_container<
|
||||
Value,IndexSpecifierList,Allocator> multi_index_type;
|
||||
@ -1059,7 +987,7 @@ get(
|
||||
multi_index_container<
|
||||
Value,IndexSpecifierList,Allocator>,
|
||||
N
|
||||
>::type index;
|
||||
>::type index_type;
|
||||
|
||||
BOOST_STATIC_ASSERT(N>=0&&
|
||||
N<
|
||||
@ -1067,7 +995,7 @@ get(
|
||||
BOOST_DEDUCED_TYPENAME multi_index_type::index_type_list
|
||||
>::type::value);
|
||||
|
||||
return detail::converter<multi_index_type,index>::index(m);
|
||||
return detail::converter<multi_index_type,index_type>::index(m);
|
||||
}
|
||||
|
||||
template<int N,typename Value,typename IndexSpecifierList,typename Allocator>
|
||||
@ -1075,7 +1003,7 @@ const typename nth_index<
|
||||
multi_index_container<Value,IndexSpecifierList,Allocator>,N>::type&
|
||||
get(
|
||||
const multi_index_container<Value,IndexSpecifierList,Allocator>& m
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int,N))
|
||||
)BOOST_NOEXCEPT
|
||||
{
|
||||
typedef multi_index_container<
|
||||
Value,IndexSpecifierList,Allocator> multi_index_type;
|
||||
@ -1083,7 +1011,7 @@ get(
|
||||
multi_index_container<
|
||||
Value,IndexSpecifierList,Allocator>,
|
||||
N
|
||||
>::type index;
|
||||
>::type index_type;
|
||||
|
||||
BOOST_STATIC_ASSERT(N>=0&&
|
||||
N<
|
||||
@ -1091,7 +1019,7 @@ get(
|
||||
BOOST_DEDUCED_TYPENAME multi_index_type::index_type_list
|
||||
>::type::value);
|
||||
|
||||
return detail::converter<multi_index_type,index>::index(m);
|
||||
return detail::converter<multi_index_type,index_type>::index(m);
|
||||
}
|
||||
|
||||
/* retrieval of indices by tag */
|
||||
@ -1119,8 +1047,7 @@ template<
|
||||
typename ::boost::multi_index::index<
|
||||
multi_index_container<Value,IndexSpecifierList,Allocator>,Tag>::type&
|
||||
get(
|
||||
multi_index_container<Value,IndexSpecifierList,Allocator>& m
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(Tag))
|
||||
multi_index_container<Value,IndexSpecifierList,Allocator>& m)BOOST_NOEXCEPT
|
||||
{
|
||||
typedef multi_index_container<
|
||||
Value,IndexSpecifierList,Allocator> multi_index_type;
|
||||
@ -1128,9 +1055,9 @@ get(
|
||||
multi_index_container<
|
||||
Value,IndexSpecifierList,Allocator>,
|
||||
Tag
|
||||
>::type index;
|
||||
>::type index_type;
|
||||
|
||||
return detail::converter<multi_index_type,index>::index(m);
|
||||
return detail::converter<multi_index_type,index_type>::index(m);
|
||||
}
|
||||
|
||||
template<
|
||||
@ -1140,7 +1067,7 @@ const typename ::boost::multi_index::index<
|
||||
multi_index_container<Value,IndexSpecifierList,Allocator>,Tag>::type&
|
||||
get(
|
||||
const multi_index_container<Value,IndexSpecifierList,Allocator>& m
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(Tag))
|
||||
)BOOST_NOEXCEPT
|
||||
{
|
||||
typedef multi_index_container<
|
||||
Value,IndexSpecifierList,Allocator> multi_index_type;
|
||||
@ -1148,9 +1075,9 @@ get(
|
||||
multi_index_container<
|
||||
Value,IndexSpecifierList,Allocator>,
|
||||
Tag
|
||||
>::type index;
|
||||
>::type index_type;
|
||||
|
||||
return detail::converter<multi_index_type,index>::index(m);
|
||||
return detail::converter<multi_index_type,index_type>::index(m);
|
||||
}
|
||||
|
||||
/* projection of iterators by number */
|
||||
@ -1158,18 +1085,13 @@ get(
|
||||
template<typename MultiIndexContainer,int N>
|
||||
struct nth_index_iterator
|
||||
{
|
||||
typedef typename detail::prevent_eti<
|
||||
nth_index<MultiIndexContainer,N>,
|
||||
typename nth_index<MultiIndexContainer,N>::type>::type::iterator type;
|
||||
typedef typename nth_index<MultiIndexContainer,N>::type::iterator type;
|
||||
};
|
||||
|
||||
template<typename MultiIndexContainer,int N>
|
||||
struct nth_index_const_iterator
|
||||
{
|
||||
typedef typename detail::prevent_eti<
|
||||
nth_index<MultiIndexContainer,N>,
|
||||
typename nth_index<MultiIndexContainer,N>::type
|
||||
>::type::const_iterator type;
|
||||
typedef typename nth_index<MultiIndexContainer,N>::type::const_iterator type;
|
||||
};
|
||||
|
||||
template<
|
||||
@ -1179,15 +1101,13 @@ typename nth_index_iterator<
|
||||
multi_index_container<Value,IndexSpecifierList,Allocator>,N>::type
|
||||
project(
|
||||
multi_index_container<Value,IndexSpecifierList,Allocator>& m,
|
||||
IteratorType it
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int,N))
|
||||
IteratorType it)
|
||||
{
|
||||
typedef multi_index_container<
|
||||
Value,IndexSpecifierList,Allocator> multi_index_type;
|
||||
typedef typename nth_index<multi_index_type,N>::type index;
|
||||
typedef typename nth_index<multi_index_type,N>::type index_type;
|
||||
|
||||
#if (!defined(BOOST_MSVC)||!(BOOST_MSVC<1310))&& /* MSVC++ 6.0/7.0 fails */\
|
||||
(!defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580)) /* as does Sun C++ 5.7 */
|
||||
#if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* Sun C++ 5.7 fails */
|
||||
BOOST_STATIC_ASSERT((
|
||||
mpl::contains<
|
||||
BOOST_DEDUCED_TYPENAME multi_index_type::iterator_type_list,
|
||||
@ -1203,7 +1123,7 @@ project(
|
||||
BOOST_MULTI_INDEX_CHECK_IS_OWNER(it,converter::index(m));
|
||||
#endif
|
||||
|
||||
return detail::converter<multi_index_type,index>::iterator(
|
||||
return detail::converter<multi_index_type,index_type>::iterator(
|
||||
m,static_cast<typename multi_index_type::node_type*>(it.get_node()));
|
||||
}
|
||||
|
||||
@ -1214,15 +1134,13 @@ typename nth_index_const_iterator<
|
||||
multi_index_container<Value,IndexSpecifierList,Allocator>,N>::type
|
||||
project(
|
||||
const multi_index_container<Value,IndexSpecifierList,Allocator>& m,
|
||||
IteratorType it
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int,N))
|
||||
IteratorType it)
|
||||
{
|
||||
typedef multi_index_container<
|
||||
Value,IndexSpecifierList,Allocator> multi_index_type;
|
||||
typedef typename nth_index<multi_index_type,N>::type index;
|
||||
typedef typename nth_index<multi_index_type,N>::type index_type;
|
||||
|
||||
#if (!defined(BOOST_MSVC)||!(BOOST_MSVC<1310))&& /* MSVC++ 6.0/7.0 fails */\
|
||||
(!defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580)) /* as does Sun C++ 5.7 */
|
||||
#if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* Sun C++ 5.7 fails */
|
||||
BOOST_STATIC_ASSERT((
|
||||
mpl::contains<
|
||||
BOOST_DEDUCED_TYPENAME multi_index_type::iterator_type_list,
|
||||
@ -1241,7 +1159,7 @@ project(
|
||||
BOOST_MULTI_INDEX_CHECK_IS_OWNER(it,converter::index(m));
|
||||
#endif
|
||||
|
||||
return detail::converter<multi_index_type,index>::const_iterator(
|
||||
return detail::converter<multi_index_type,index_type>::const_iterator(
|
||||
m,static_cast<typename multi_index_type::node_type*>(it.get_node()));
|
||||
}
|
||||
|
||||
@ -1268,16 +1186,14 @@ typename index_iterator<
|
||||
multi_index_container<Value,IndexSpecifierList,Allocator>,Tag>::type
|
||||
project(
|
||||
multi_index_container<Value,IndexSpecifierList,Allocator>& m,
|
||||
IteratorType it
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(Tag))
|
||||
IteratorType it)
|
||||
{
|
||||
typedef multi_index_container<
|
||||
Value,IndexSpecifierList,Allocator> multi_index_type;
|
||||
typedef typename ::boost::multi_index::index<
|
||||
multi_index_type,Tag>::type index;
|
||||
multi_index_type,Tag>::type index_type;
|
||||
|
||||
#if (!defined(BOOST_MSVC)||!(BOOST_MSVC<1310))&& /* MSVC++ 6.0/7.0 fails */\
|
||||
(!defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580)) /* as does Sun C++ 5.7 */
|
||||
#if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* Sun C++ 5.7 fails */
|
||||
BOOST_STATIC_ASSERT((
|
||||
mpl::contains<
|
||||
BOOST_DEDUCED_TYPENAME multi_index_type::iterator_type_list,
|
||||
@ -1293,7 +1209,7 @@ project(
|
||||
BOOST_MULTI_INDEX_CHECK_IS_OWNER(it,converter::index(m));
|
||||
#endif
|
||||
|
||||
return detail::converter<multi_index_type,index>::iterator(
|
||||
return detail::converter<multi_index_type,index_type>::iterator(
|
||||
m,static_cast<typename multi_index_type::node_type*>(it.get_node()));
|
||||
}
|
||||
|
||||
@ -1304,16 +1220,14 @@ typename index_const_iterator<
|
||||
multi_index_container<Value,IndexSpecifierList,Allocator>,Tag>::type
|
||||
project(
|
||||
const multi_index_container<Value,IndexSpecifierList,Allocator>& m,
|
||||
IteratorType it
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(Tag))
|
||||
IteratorType it)
|
||||
{
|
||||
typedef multi_index_container<
|
||||
Value,IndexSpecifierList,Allocator> multi_index_type;
|
||||
typedef typename ::boost::multi_index::index<
|
||||
multi_index_type,Tag>::type index;
|
||||
multi_index_type,Tag>::type index_type;
|
||||
|
||||
#if (!defined(BOOST_MSVC)||!(BOOST_MSVC<1310))&& /* MSVC++ 6.0/7.0 fails */\
|
||||
(!defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580)) /* as does Sun C++ 5.7 */
|
||||
#if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* Sun C++ 5.7 fails */
|
||||
BOOST_STATIC_ASSERT((
|
||||
mpl::contains<
|
||||
BOOST_DEDUCED_TYPENAME multi_index_type::iterator_type_list,
|
||||
@ -1332,7 +1246,7 @@ project(
|
||||
BOOST_MULTI_INDEX_CHECK_IS_OWNER(it,converter::index(m));
|
||||
#endif
|
||||
|
||||
return detail::converter<multi_index_type,index>::const_iterator(
|
||||
return detail::converter<multi_index_type,index_type>::const_iterator(
|
||||
m,static_cast<typename multi_index_type::node_type*>(it.get_node()));
|
||||
}
|
||||
|
||||
@ -1416,8 +1330,7 @@ void swap(
|
||||
|
||||
} /* namespace multi_index */
|
||||
|
||||
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)&&\
|
||||
!defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
|
||||
/* class version = 1 : we now serialize the size through
|
||||
* boost::serialization::collection_size_type.
|
||||
* class version = 2 : proper use of {save|load}_construct_data.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -9,7 +9,7 @@
|
||||
#ifndef BOOST_MULTI_INDEX_FWD_HPP
|
||||
#define BOOST_MULTI_INDEX_FWD_HPP
|
||||
|
||||
#if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
||||
#if defined(_MSC_VER)
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Boost.MultiIndex performance test.
|
||||
*
|
||||
* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
||||
* Copyright 2003-2013 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -339,10 +339,7 @@ private:
|
||||
*/
|
||||
|
||||
template <typename IndexedTest,typename ManualTest>
|
||||
void run_tests(
|
||||
const char* title
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(IndexedTest)
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(ManualTest))
|
||||
void run_tests(const char* title)
|
||||
{
|
||||
cout<<fixed<<setprecision(2);
|
||||
cout<<title<<endl;
|
||||
@ -374,10 +371,7 @@ void run_tests(
|
||||
*/
|
||||
|
||||
template <typename IndexedType,typename ManualType>
|
||||
void compare_structures(
|
||||
const char* title
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(IndexedType)
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(ManualType))
|
||||
void compare_structures(const char* title)
|
||||
{
|
||||
run_tests<
|
||||
mono_container<IndexedType>,
|
||||
@ -386,11 +380,7 @@ void compare_structures(
|
||||
}
|
||||
|
||||
template <typename IndexedType,typename ManualType1,typename ManualType2>
|
||||
void compare_structures2(
|
||||
const char* title
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(IndexedType)
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(ManualType1)
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(ManualType2))
|
||||
void compare_structures2(const char* title)
|
||||
{
|
||||
run_tests<
|
||||
mono_container<IndexedType>,
|
||||
@ -402,12 +392,7 @@ template <
|
||||
typename IndexedType,
|
||||
typename ManualType1,typename ManualType2,typename ManualType3
|
||||
>
|
||||
void compare_structures3(
|
||||
const char* title
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(IndexedType)
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(ManualType1)
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(ManualType2)
|
||||
BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(ManualType3))
|
||||
void compare_structures3(const char* title)
|
||||
{
|
||||
run_tests<
|
||||
mono_container<IndexedType>,
|
||||
@ -417,12 +402,14 @@ void compare_structures3(
|
||||
|
||||
int main()
|
||||
{
|
||||
/* some stdlibs provide the discussed but finally rejected std::identity */
|
||||
using boost::multi_index::identity;
|
||||
|
||||
{
|
||||
/* 1 ordered index */
|
||||
|
||||
typedef multi_index_container<int> indexed_t;
|
||||
typedef set<int> manual_t;
|
||||
indexed_t dummy; /* MSVC++ 6.0 chokes if indexed_t is not instantiated */
|
||||
|
||||
compare_structures<indexed_t,manual_t>(
|
||||
"1 ordered index");
|
||||
@ -437,7 +424,6 @@ int main()
|
||||
>
|
||||
> indexed_t;
|
||||
typedef list_wrapper<list<int> > manual_t;
|
||||
indexed_t dummy; /* MSVC++ 6.0 chokes if indexed_t is not instantiated */
|
||||
|
||||
compare_structures<indexed_t,manual_t>(
|
||||
"1 sequenced index");
|
||||
@ -460,7 +446,6 @@ int main()
|
||||
manual_t1::key_compare
|
||||
>
|
||||
> manual_t2;
|
||||
indexed_t dummy; /* MSVC++ 6.0 chokes if indexed_t is not instantiated */
|
||||
|
||||
compare_structures2<indexed_t,manual_t1,manual_t2>(
|
||||
"2 ordered indices");
|
||||
@ -485,7 +470,6 @@ int main()
|
||||
std::less<int>
|
||||
>
|
||||
> manual_t2;
|
||||
indexed_t dummy; /* MSVC++ 6.0 chokes if indexed_t is not instantiated */
|
||||
|
||||
compare_structures2<indexed_t,manual_t1,manual_t2>(
|
||||
"1 ordered index + 1 sequenced index");
|
||||
@ -518,7 +502,6 @@ int main()
|
||||
manual_t2::key_compare
|
||||
>
|
||||
> manual_t3;
|
||||
indexed_t dummy; /* MSVC++ 6.0 chokes if indexed_t is not instantiated */
|
||||
|
||||
compare_structures3<indexed_t,manual_t1,manual_t2,manual_t3>(
|
||||
"3 ordered indices");
|
||||
@ -553,7 +536,6 @@ int main()
|
||||
manual_t2::key_compare
|
||||
>
|
||||
> manual_t3;
|
||||
indexed_t dummy; /* MSVC++ 6.0 chokes if indexed_t is not instantiated */
|
||||
|
||||
compare_structures3<indexed_t,manual_t1,manual_t2,manual_t3>(
|
||||
"2 ordered indices + 1 sequenced index");
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||
#include "pre_multi_index.hpp"
|
||||
#include "employee.hpp"
|
||||
#include "pair_of_ints.hpp"
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
using namespace boost::multi_index;
|
||||
@ -42,8 +43,10 @@ struct lookup_vector{
|
||||
void test_comparison()
|
||||
{
|
||||
employee_set es;
|
||||
employee_set_by_name& i1=get<1>(es);
|
||||
employee_set_by_age& i2=get<2>(es);
|
||||
employee_set_as_inserted& i3=get<3>(es);
|
||||
employee_set_by_ssn& i4=get<4>(es);
|
||||
employee_set_randomly& i5=get<5>(es);
|
||||
es.insert(employee(0,"Joe",31,1123));
|
||||
es.insert(employee(1,"Robert",27,5601));
|
||||
@ -52,8 +55,10 @@ void test_comparison()
|
||||
es.insert(employee(4,"John",57,1002));
|
||||
|
||||
employee_set es2;
|
||||
employee_set_by_name& i12=get<by_name>(es2);
|
||||
employee_set_by_age& i22=get<age>(es2);
|
||||
employee_set_as_inserted& i32=get<3>(es2);
|
||||
employee_set_by_ssn& i42=get<4>(es2);
|
||||
employee_set_randomly& i52=get<5>(es2);
|
||||
es2.insert(employee(0,"Joe",31,1123));
|
||||
es2.insert(employee(1,"Robert",27,5601));
|
||||
@ -61,14 +66,43 @@ void test_comparison()
|
||||
es2.insert(employee(3,"Albert",20,9012));
|
||||
|
||||
BOOST_TEST(es==es&&es<=es&&es>=es&&
|
||||
i22==i22&&i22<=i22&&i22>=i22&&
|
||||
i32==i32&&i32<=i32&&i32>=i32&&
|
||||
i52==i52&&i52<=i52&&i52>=i52);
|
||||
i12==i12&&
|
||||
i22==i22&&i22<=i22&&i22>=i22&&
|
||||
i32==i32&&i32<=i32&&i32>=i32&&
|
||||
i42==i42&&
|
||||
i52==i52&&i52<=i52&&i52>=i52);
|
||||
BOOST_TEST(es!=es2&&es2<es&&es>es2&&!(es<=es2)&&!(es2>=es));
|
||||
BOOST_TEST(i1!=i12);
|
||||
BOOST_TEST(i2!=i22&&i22<i2&&i2>i22&&!(i2<=i22)&&!(i22>=i2));
|
||||
BOOST_TEST(i3!=i32&&i32<i3&&i3>i32&&!(i3<=i32)&&!(i32>=i3));
|
||||
BOOST_TEST(i4!=i42);
|
||||
BOOST_TEST(i5!=i52&&i52<i5&&i5>i52&&!(i5<=i52)&&!(i52>=i5));
|
||||
|
||||
multi_index_container<
|
||||
pair_of_ints,
|
||||
indexed_by<
|
||||
hashed_non_unique<BOOST_MULTI_INDEX_MEMBER(pair_of_ints,int,first)>
|
||||
>
|
||||
> hc1,hc2;
|
||||
hc1.insert(pair_of_ints(0,0));
|
||||
hc1.insert(pair_of_ints(0,1));
|
||||
hc1.insert(pair_of_ints(0,2));
|
||||
hc1.insert(pair_of_ints(0,3));
|
||||
hc1.insert(pair_of_ints(1,0));
|
||||
hc1.insert(pair_of_ints(1,1));
|
||||
|
||||
hc2.insert(pair_of_ints(0,2));
|
||||
hc2.insert(pair_of_ints(0,1));
|
||||
hc2.insert(pair_of_ints(1,1));
|
||||
hc2.insert(pair_of_ints(1,0));
|
||||
hc2.insert(pair_of_ints(0,3));
|
||||
hc2.insert(pair_of_ints(0,0));
|
||||
BOOST_TEST(hc1==hc2);
|
||||
|
||||
hc1.insert(pair_of_ints(0,4));
|
||||
hc2.insert(pair_of_ints(0,5));
|
||||
BOOST_TEST(hc1!=hc2);
|
||||
|
||||
lookup_list<int>::type l1;
|
||||
lookup_list<char>::type l2;
|
||||
lookup_vector<char>::type l3;
|
||||
|
@ -74,12 +74,9 @@ struct comparison_equal_length
|
||||
composite_key_result_equal_to<CompositeKeyResult> eq;
|
||||
composite_key_result_less<CompositeKeyResult> lt;
|
||||
composite_key_result_greater<CompositeKeyResult> gt;
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
std::equal_to<CompositeKeyResult> std_eq;
|
||||
std::less<CompositeKeyResult> std_lt;
|
||||
std::greater<CompositeKeyResult> std_gt;
|
||||
#endif
|
||||
std::equal_to<CompositeKeyResult> std_eq;
|
||||
std::less<CompositeKeyResult> std_lt;
|
||||
std::greater<CompositeKeyResult> std_gt;
|
||||
|
||||
return (x< y) && !(y< x)&&
|
||||
!(x==y) && !(y==x)&&
|
||||
@ -87,18 +84,12 @@ struct comparison_equal_length
|
||||
!(x> y) && (y> x)&&
|
||||
!(x>=y) && (y>=x)&&
|
||||
(x<=y) && !(y<=x)&&
|
||||
|
||||
!eq(x,y) && !eq(y,x)&&
|
||||
lt(x,y) && !lt(y,x)&&
|
||||
!gt(x,y) && gt(y,x)
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
&&
|
||||
!gt(x,y) && gt(y,x)&&
|
||||
!std_eq(x,y) && !std_eq(y,x)&&
|
||||
std_lt(x,y) && !std_lt(y,x)&&
|
||||
!std_gt(x,y) && std_gt(y,x)
|
||||
#endif
|
||||
;
|
||||
!std_gt(x,y) && std_gt(y,x);
|
||||
}
|
||||
|
||||
static bool is_greater(const CompositeKeyResult& x,const T2& y)
|
||||
@ -106,12 +97,9 @@ struct comparison_equal_length
|
||||
composite_key_result_equal_to<CompositeKeyResult> eq;
|
||||
composite_key_result_less<CompositeKeyResult> lt;
|
||||
composite_key_result_greater<CompositeKeyResult> gt;
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
std::equal_to<CompositeKeyResult> std_eq;
|
||||
std::less<CompositeKeyResult> std_lt;
|
||||
std::greater<CompositeKeyResult> std_gt;
|
||||
#endif
|
||||
std::equal_to<CompositeKeyResult> std_eq;
|
||||
std::less<CompositeKeyResult> std_lt;
|
||||
std::greater<CompositeKeyResult> std_gt;
|
||||
|
||||
return !(x< y) && (y< x)&&
|
||||
!(x==y) && !(y==x)&&
|
||||
@ -119,18 +107,12 @@ struct comparison_equal_length
|
||||
(x> y) && !(y> x)&&
|
||||
(x>=y) && !(y>=x)&&
|
||||
!(x<=y) && (y<=x)&&
|
||||
|
||||
!eq(x,y) && !eq(y,x)&&
|
||||
!lt(x,y) && lt(y,x)&&
|
||||
gt(x,y) && !gt(y,x)
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
&&
|
||||
gt(x,y) && !gt(y,x)&&
|
||||
!std_eq(x,y) && !std_eq(y,x)&&
|
||||
!std_lt(x,y) && std_lt(y,x)&&
|
||||
std_gt(x,y) && !std_gt(y,x)
|
||||
#endif
|
||||
;
|
||||
std_gt(x,y) && !std_gt(y,x);
|
||||
}
|
||||
|
||||
static bool is_equiv(const CompositeKeyResult& x,const T2& y)
|
||||
@ -138,12 +120,9 @@ struct comparison_equal_length
|
||||
composite_key_result_equal_to<CompositeKeyResult> eq;
|
||||
composite_key_result_less<CompositeKeyResult> lt;
|
||||
composite_key_result_greater<CompositeKeyResult> gt;
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
std::equal_to<CompositeKeyResult> std_eq;
|
||||
std::less<CompositeKeyResult> std_lt;
|
||||
std::greater<CompositeKeyResult> std_gt;
|
||||
#endif
|
||||
std::equal_to<CompositeKeyResult> std_eq;
|
||||
std::less<CompositeKeyResult> std_lt;
|
||||
std::greater<CompositeKeyResult> std_gt;
|
||||
|
||||
return !(x< y) && !(y< x)&&
|
||||
(x==y) && (y==x)&&
|
||||
@ -151,18 +130,12 @@ struct comparison_equal_length
|
||||
!(x> y) && !(y> x)&&
|
||||
(x>=y) && (y>=x)&&
|
||||
(x<=y) && (y<=x)&&
|
||||
|
||||
eq(x,y) && eq(y,x)&&
|
||||
!lt(x,y) && !lt(y,x)&&
|
||||
!gt(x,y) && !gt(y,x)
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
&&
|
||||
!gt(x,y) && !gt(y,x)&&
|
||||
std_eq(x,y) && std_eq(y,x)&&
|
||||
!std_lt(x,y) && !std_lt(y,x)&&
|
||||
!std_gt(x,y) && !std_gt(y,x)
|
||||
#endif
|
||||
;
|
||||
!std_gt(x,y) && !std_gt(y,x);
|
||||
}
|
||||
};
|
||||
|
||||
@ -173,78 +146,51 @@ struct comparison_different_length
|
||||
{
|
||||
composite_key_result_less<CompositeKeyResult> lt;
|
||||
composite_key_result_greater<CompositeKeyResult> gt;
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
std::less<CompositeKeyResult> std_lt;
|
||||
std::greater<CompositeKeyResult> std_gt;
|
||||
#endif
|
||||
std::less<CompositeKeyResult> std_lt;
|
||||
std::greater<CompositeKeyResult> std_gt;
|
||||
|
||||
return (x< y) && !(y< x)&&
|
||||
!(x> y) && (y> x)&&
|
||||
!(x>=y) && (y>=x)&&
|
||||
(x<=y) && !(y<=x)&&
|
||||
|
||||
lt(x,y) && !lt(y,x)&&
|
||||
!gt(x,y) && gt(y,x)
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
&&
|
||||
!gt(x,y) && gt(y,x)&&
|
||||
std_lt(x,y) && !std_lt(y,x)&&
|
||||
!std_gt(x,y) && std_gt(y,x)
|
||||
#endif
|
||||
;
|
||||
!std_gt(x,y) && std_gt(y,x);
|
||||
}
|
||||
|
||||
static bool is_greater(const CompositeKeyResult& x,const T2& y)
|
||||
{
|
||||
composite_key_result_less<CompositeKeyResult> lt;
|
||||
composite_key_result_greater<CompositeKeyResult> gt;
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
std::less<CompositeKeyResult> std_lt;
|
||||
std::greater<CompositeKeyResult> std_gt;
|
||||
#endif
|
||||
std::less<CompositeKeyResult> std_lt;
|
||||
std::greater<CompositeKeyResult> std_gt;
|
||||
|
||||
return !(x< y) && (y< x)&&
|
||||
(x> y) && !(y> x)&&
|
||||
(x>=y) && !(y>=x)&&
|
||||
!(x<=y) && (y<=x)&&
|
||||
|
||||
!lt(x,y) && lt(y,x)&&
|
||||
gt(x,y) && !gt(y,x)
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
&&
|
||||
gt(x,y) && !gt(y,x)&&
|
||||
!std_lt(x,y) && std_lt(y,x)&&
|
||||
std_gt(x,y) && !std_gt(y,x)
|
||||
#endif
|
||||
;
|
||||
std_gt(x,y) && !std_gt(y,x);
|
||||
}
|
||||
|
||||
static bool is_equiv(const CompositeKeyResult& x,const T2& y)
|
||||
{
|
||||
composite_key_result_less<CompositeKeyResult> lt;
|
||||
composite_key_result_greater<CompositeKeyResult> gt;
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
std::less<CompositeKeyResult> std_lt;
|
||||
std::greater<CompositeKeyResult> std_gt;
|
||||
#endif
|
||||
std::less<CompositeKeyResult> std_lt;
|
||||
std::greater<CompositeKeyResult> std_gt;
|
||||
|
||||
return !(x< y) && !(y< x)&&
|
||||
!(x> y) && !(y> x)&&
|
||||
(x>=y) && (y>=x)&&
|
||||
(x<=y) && (y<=x)&&
|
||||
|
||||
!lt(x,y) && !lt(y,x)&&
|
||||
!gt(x,y) && !gt(y,x)
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
&&
|
||||
!gt(x,y) && !gt(y,x)&&
|
||||
!std_lt(x,y) && !std_lt(y,x)&&
|
||||
!std_gt(x,y) && !std_gt(y,x)
|
||||
#endif
|
||||
;
|
||||
!std_gt(x,y) && !std_gt(y,x);
|
||||
}
|
||||
};
|
||||
|
||||
@ -355,12 +301,7 @@ void test_composite_key()
|
||||
typedef multi_index_container<
|
||||
xyz,
|
||||
indexed_by<
|
||||
ordered_unique<
|
||||
ckey_t1
|
||||
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
,composite_key_result_less<ckey_t1::result_type>
|
||||
#endif
|
||||
>
|
||||
ordered_unique<ckey_t1>
|
||||
>
|
||||
> indexed_t1;
|
||||
|
||||
@ -576,13 +517,7 @@ void test_composite_key()
|
||||
typedef multi_index_container<
|
||||
xyz,
|
||||
indexed_by<
|
||||
hashed_unique<
|
||||
ckey_t1
|
||||
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
,composite_key_result_hash<ckey_t1::result_type>
|
||||
,composite_key_result_equal_to<ckey_t1::result_type>
|
||||
#endif
|
||||
>
|
||||
hashed_unique<ckey_t1>
|
||||
>
|
||||
> indexed_t2;
|
||||
|
||||
|
@ -39,7 +39,7 @@ struct holder
|
||||
};
|
||||
|
||||
template<typename Sequence>
|
||||
static void test_assign(BOOST_EXPLICIT_TEMPLATE_TYPE(Sequence))
|
||||
static void test_assign()
|
||||
{
|
||||
Sequence s;
|
||||
|
||||
@ -72,7 +72,7 @@ static void test_assign(BOOST_EXPLICIT_TEMPLATE_TYPE(Sequence))
|
||||
#endif
|
||||
|
||||
template<typename Sequence>
|
||||
static void test_integral_assign(BOOST_EXPLICIT_TEMPLATE_TYPE(Sequence))
|
||||
static void test_integral_assign()
|
||||
{
|
||||
/* Special cases described in 23.1.1/9: integral types must not
|
||||
* be taken as iterators in assign(f,l) and insert(p,f,l).
|
||||
@ -213,25 +213,17 @@ void test_copy_assignment()
|
||||
l.push_back(employee(1,"Rachel",27,9012));
|
||||
l.push_back(employee(2,"Agatha",40,1520));
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
|
||||
employee_set es13;
|
||||
es13.insert(l.begin(),l.end());
|
||||
#else
|
||||
employee_set es13(l.begin(),l.end());
|
||||
#endif
|
||||
|
||||
l.sort();
|
||||
|
||||
BOOST_TEST(es13.size()==l.size()&&
|
||||
std::equal(es13.begin(),es13.end(),l.begin()));
|
||||
|
||||
/* MSVC++ 6.0 chokes on test_assign without this explicit instantiation */
|
||||
multi_index_container<int,indexed_by<sequenced<> > > s1;
|
||||
test_assign<multi_index_container<int,indexed_by<sequenced<> > > >();
|
||||
test_integral_assign<
|
||||
multi_index_container<int,indexed_by<sequenced<> > > >();
|
||||
|
||||
multi_index_container<int,indexed_by<random_access<> > > s2;
|
||||
test_assign<multi_index_container<int,indexed_by<random_access<> > > >();
|
||||
test_integral_assign<
|
||||
multi_index_container<int,indexed_by<random_access<> > > >();
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <boost/multi_index_container.hpp>
|
||||
#include <boost/multi_index/hashed_index.hpp>
|
||||
#include <boost/multi_index/identity.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@ -90,4 +91,28 @@ void test_hash_ops()
|
||||
hc.rehash(1);
|
||||
BOOST_TEST(hc.bucket_count()>=1);
|
||||
check_load_factor(hc);
|
||||
|
||||
hash_container hc2;
|
||||
hc2.insert(0);
|
||||
hc2.max_load_factor(0.5f/hc2.bucket_count());
|
||||
BOOST_TEST(hc2.load_factor()>hc2.max_load_factor());
|
||||
hc2.reserve(1);
|
||||
BOOST_TEST(hc2.load_factor()<hc2.max_load_factor());
|
||||
|
||||
hash_container hc3;
|
||||
hc3.clear();
|
||||
hc3.max_load_factor(1.0f);
|
||||
hc3.reserve(1000);
|
||||
hash_container::size_type bc3=hc3.bucket_count();
|
||||
BOOST_TEST(bc3>=1000);
|
||||
std::vector<int> v;
|
||||
for(unsigned int n=0;n<bc3;++n)v.push_back(n);
|
||||
hc3.insert(v.begin(),v.end());
|
||||
BOOST_TEST(hc3.bucket_count()==bc3); /* LWG issue 2156 */
|
||||
hc3.max_load_factor(0.25f);
|
||||
hc3.reserve(100);
|
||||
BOOST_TEST(hc3.bucket_count()>bc3);
|
||||
bc3=hc3.bucket_count();
|
||||
hc3.reserve((hash_container::size_type)(3.0f*hc3.max_load_factor()*bc3));
|
||||
BOOST_TEST(hc3.bucket_count()>bc3);
|
||||
}
|
||||
|
@ -62,9 +62,6 @@ struct test_derived_class:test_class
|
||||
test_derived_class(int i,int j):test_class(i,j){}
|
||||
};
|
||||
|
||||
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(test_class)
|
||||
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(test_derived_class)
|
||||
|
||||
typedef identity<test_class> idn;
|
||||
typedef identity<const test_class> cidn;
|
||||
typedef BOOST_MULTI_INDEX_MEMBER(test_class,int,int_member) key_m;
|
||||
@ -134,9 +131,6 @@ struct test_nc_derived_class:test_nc_class
|
||||
test_nc_derived_class(int i,int j):test_nc_class(i,j){}
|
||||
};
|
||||
|
||||
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(test_nc_class)
|
||||
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(test_nc_derived_class)
|
||||
|
||||
typedef identity<test_nc_class> nc_idn;
|
||||
typedef identity<const test_nc_class> nc_cidn;
|
||||
typedef BOOST_MULTI_INDEX_MEMBER(test_nc_class,int,int_member) nc_key_m;
|
||||
|
@ -73,7 +73,7 @@ bool is_sorted(
|
||||
#endif
|
||||
|
||||
template<typename Sequence>
|
||||
static void test_list_ops_unique_seq(BOOST_EXPLICIT_TEMPLATE_TYPE(Sequence))
|
||||
static void test_list_ops_unique_seq()
|
||||
{
|
||||
typedef typename nth_index<Sequence,1>::type sequenced_index;
|
||||
|
||||
@ -158,8 +158,7 @@ static void test_list_ops_unique_seq(BOOST_EXPLICIT_TEMPLATE_TYPE(Sequence))
|
||||
}
|
||||
|
||||
template<typename Sequence>
|
||||
static void test_list_ops_non_unique_seq(
|
||||
BOOST_EXPLICIT_TEMPLATE_TYPE(Sequence))
|
||||
static void test_list_ops_non_unique_seq()
|
||||
{
|
||||
typedef typename Sequence::iterator iterator;
|
||||
|
||||
@ -199,37 +198,37 @@ static void test_list_ops_non_unique_seq(
|
||||
* http://lists.boost.org/boost-users/2006/09/22604.php
|
||||
*/
|
||||
{
|
||||
Sequence ss,ss2;
|
||||
ss.push_back(0);
|
||||
ss2.push_back(0);
|
||||
ss.splice(ss.end(),ss2,ss2.begin());
|
||||
CHECK_EQUAL(ss,(0)(0));
|
||||
BOOST_TEST(ss2.empty());
|
||||
Sequence ss_,ss2_;
|
||||
ss_.push_back(0);
|
||||
ss2_.push_back(0);
|
||||
ss_.splice(ss_.end(),ss2_,ss2_.begin());
|
||||
CHECK_EQUAL(ss_,(0)(0));
|
||||
BOOST_TEST(ss2_.empty());
|
||||
|
||||
ss.clear();
|
||||
ss2.clear();
|
||||
ss.push_back(0);
|
||||
ss2.push_back(0);
|
||||
ss.splice(ss.end(),ss2,ss2.begin(),ss2.end());
|
||||
CHECK_EQUAL(ss,(0)(0));
|
||||
BOOST_TEST(ss2.empty());
|
||||
ss_.clear();
|
||||
ss2_.clear();
|
||||
ss_.push_back(0);
|
||||
ss2_.push_back(0);
|
||||
ss_.splice(ss_.end(),ss2_,ss2_.begin(),ss2_.end());
|
||||
CHECK_EQUAL(ss_,(0)(0));
|
||||
BOOST_TEST(ss2_.empty());
|
||||
|
||||
ss.clear();
|
||||
ss2.clear();
|
||||
ss.push_back(0);
|
||||
ss2.push_back(0);
|
||||
ss.merge(ss2);
|
||||
CHECK_EQUAL(ss,(0)(0));
|
||||
BOOST_TEST(ss2.empty());
|
||||
ss_.clear();
|
||||
ss2_.clear();
|
||||
ss_.push_back(0);
|
||||
ss2_.push_back(0);
|
||||
ss_.merge(ss2_);
|
||||
CHECK_EQUAL(ss_,(0)(0));
|
||||
BOOST_TEST(ss2_.empty());
|
||||
|
||||
typedef typename Sequence::value_type value_type;
|
||||
ss.clear();
|
||||
ss2.clear();
|
||||
ss.push_back(0);
|
||||
ss2.push_back(0);
|
||||
ss.merge(ss2,std::less<value_type>());
|
||||
CHECK_EQUAL(ss,(0)(0));
|
||||
BOOST_TEST(ss2.empty());
|
||||
ss_.clear();
|
||||
ss2_.clear();
|
||||
ss_.push_back(0);
|
||||
ss2_.push_back(0);
|
||||
ss_.merge(ss2_,std::less<value_type>());
|
||||
CHECK_EQUAL(ss_,(0)(0));
|
||||
BOOST_TEST(ss2_.empty());
|
||||
}
|
||||
}
|
||||
|
||||
@ -247,10 +246,6 @@ void test_list_ops()
|
||||
>
|
||||
> sequenced_set;
|
||||
|
||||
/* MSVC++ 6.0 chokes on test_list_ops_unique_seq without this
|
||||
* explicit instantiation
|
||||
*/
|
||||
sequenced_set ss;
|
||||
test_list_ops_unique_seq<sequenced_set>();
|
||||
|
||||
|
||||
@ -262,7 +257,6 @@ void test_list_ops()
|
||||
>
|
||||
> random_access_set;
|
||||
|
||||
random_access_set rs;
|
||||
test_list_ops_unique_seq<random_access_set>();
|
||||
|
||||
typedef multi_index_container<
|
||||
@ -270,7 +264,6 @@ void test_list_ops()
|
||||
indexed_by<sequenced<> >
|
||||
> int_list;
|
||||
|
||||
int_list il;
|
||||
test_list_ops_non_unique_seq<int_list>();
|
||||
|
||||
typedef multi_index_container<
|
||||
@ -278,6 +271,5 @@ void test_list_ops()
|
||||
indexed_by<random_access<> >
|
||||
> int_vector;
|
||||
|
||||
int_vector iv;
|
||||
test_list_ops_non_unique_seq<int_vector>();
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ using namespace boost::multi_index;
|
||||
#endif
|
||||
|
||||
template<typename Sequence>
|
||||
static void local_test_rearrange(BOOST_EXPLICIT_TEMPLATE_TYPE(Sequence))
|
||||
static void local_test_rearrange()
|
||||
{
|
||||
typedef typename Sequence::iterator iterator;
|
||||
typedef typename Sequence::value_type value_type;
|
||||
@ -121,10 +121,6 @@ void test_rearrange()
|
||||
indexed_by<sequenced<> >
|
||||
> int_list;
|
||||
|
||||
/* MSVC++ 6.0 chokes on local_test_rearrange without this
|
||||
* explicit instantiation
|
||||
*/
|
||||
int_list il;
|
||||
local_test_rearrange<int_list>();
|
||||
|
||||
typedef multi_index_container<
|
||||
@ -132,6 +128,5 @@ void test_rearrange()
|
||||
indexed_by<random_access<> >
|
||||
> int_vector;
|
||||
|
||||
int_vector iv;
|
||||
local_test_rearrange<int_vector>();
|
||||
}
|
||||
|
@ -266,15 +266,14 @@ static void local_test_safe_mode(
|
||||
}
|
||||
|
||||
template<typename Policy>
|
||||
static void local_test_safe_mode(BOOST_EXPLICIT_TEMPLATE_TYPE(Policy))
|
||||
static void local_test_safe_mode()
|
||||
{
|
||||
typedef typename Policy::index_type::iterator::iterator_category category;
|
||||
::local_test_safe_mode<Policy>(category());
|
||||
}
|
||||
|
||||
template<typename Policy>
|
||||
static void local_test_safe_mode_with_rearrange(
|
||||
BOOST_EXPLICIT_TEMPLATE_TYPE(Policy))
|
||||
static void local_test_safe_mode_with_rearrange()
|
||||
{
|
||||
::local_test_safe_mode<Policy>();
|
||||
|
||||
@ -329,11 +328,8 @@ static void local_test_safe_mode_with_rearrange(
|
||||
template<typename MultiIndexContainer,int N>
|
||||
struct index_policy_base
|
||||
{
|
||||
typedef MultiIndexContainer container;
|
||||
typedef typename
|
||||
boost::multi_index::detail::prevent_eti<
|
||||
container,
|
||||
typename nth_index<container,N>::type>::type index_type;
|
||||
typedef MultiIndexContainer container;
|
||||
typedef typename nth_index<container,N>::type index_type;
|
||||
|
||||
static index_type& index_from_container(container& c){return get<N>(c);}
|
||||
};
|
||||
@ -409,7 +405,7 @@ struct employee_set_randomly_policy:
|
||||
{};
|
||||
|
||||
template<typename IntegralBimap>
|
||||
static void test_integral_bimap(BOOST_EXPLICIT_TEMPLATE_TYPE(IntegralBimap))
|
||||
static void test_integral_bimap()
|
||||
{
|
||||
typedef typename IntegralBimap::value_type value_type;
|
||||
typedef typename IntegralBimap::iterator iterator;
|
||||
@ -447,10 +443,6 @@ void test_safe_mode()
|
||||
ordered_unique<BOOST_MULTI_INDEX_MEMBER(pair_of_ints,int,second)> >
|
||||
> bimap0_type;
|
||||
|
||||
/* MSVC++ 6.0 chokes on test_integral_bimap without this
|
||||
* explicit instantiation
|
||||
*/
|
||||
bimap0_type bm0;
|
||||
test_integral_bimap<bimap0_type>();
|
||||
|
||||
typedef multi_index_container<
|
||||
@ -460,7 +452,6 @@ void test_safe_mode()
|
||||
hashed_unique<BOOST_MULTI_INDEX_MEMBER(pair_of_ints,int,second)> >
|
||||
> bimap1_type;
|
||||
|
||||
bimap1_type bm1;
|
||||
test_integral_bimap<bimap1_type>();
|
||||
|
||||
typedef multi_index_container<
|
||||
@ -470,7 +461,6 @@ void test_safe_mode()
|
||||
ordered_unique<BOOST_MULTI_INDEX_MEMBER(pair_of_ints,int,second)> >
|
||||
> bimap2_type;
|
||||
|
||||
bimap2_type bm2;
|
||||
test_integral_bimap<bimap2_type>();
|
||||
|
||||
typedef multi_index_container<
|
||||
@ -480,6 +470,5 @@ void test_safe_mode()
|
||||
hashed_unique<BOOST_MULTI_INDEX_MEMBER(pair_of_ints,int,second)> >
|
||||
> bimap3_type;
|
||||
|
||||
bimap3_type bm3;
|
||||
test_integral_bimap<bimap3_type>();
|
||||
}
|
||||
|
@ -35,9 +35,7 @@ template<class Archive>
|
||||
void save_construct_data(
|
||||
Archive& ar,const non_default_ctble* p,const unsigned int version)
|
||||
{
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
if(version<3)return;
|
||||
#endif
|
||||
|
||||
ar<<boost::serialization::make_nvp("n",p->n);
|
||||
}
|
||||
@ -46,9 +44,7 @@ template<class Archive>
|
||||
void load_construct_data(
|
||||
Archive& ar,non_default_ctble* p,const unsigned int version)
|
||||
{
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
if(version<3)return;
|
||||
#endif
|
||||
|
||||
int n=0;
|
||||
ar>>boost::serialization::make_nvp("n",n);
|
||||
@ -145,10 +141,10 @@ void test_serialization3()
|
||||
for(std::size_t buc=0;buc<hs2.bucket_count();++buc){
|
||||
for(std::size_t k=0;k<hs2.bucket_size(buc);++k){
|
||||
int n;
|
||||
local_iterator it;
|
||||
local_iterator it_;
|
||||
ia>>n;
|
||||
ia>>it;
|
||||
BOOST_TEST(*it==n);
|
||||
ia>>it_;
|
||||
BOOST_TEST(*it_==n);
|
||||
}
|
||||
local_iterator it2;
|
||||
ia>>it2;
|
||||
|
@ -31,17 +31,33 @@ struct null_hash
|
||||
std::size_t operator()(const T&)const{return 0;}
|
||||
};
|
||||
|
||||
struct assign_value
|
||||
{
|
||||
assign_value(int n):n_(n){}
|
||||
|
||||
void operator()(int& x)const{x=n_;}
|
||||
|
||||
int n_;
|
||||
};
|
||||
|
||||
template<class MultiIndexContainer>
|
||||
void test_stable_update(BOOST_EXPLICIT_TEMPLATE_TYPE(MultiIndexContainer))
|
||||
void test_stable_update()
|
||||
{
|
||||
typedef typename MultiIndexContainer::iterator iterator;
|
||||
typedef typename MultiIndexContainer::size_type size_type;
|
||||
|
||||
MultiIndexContainer c;
|
||||
c.insert(0);c.insert(0);c.insert(0);c.insert(0);
|
||||
c.insert(1);c.insert(1);c.insert(1);
|
||||
c.insert(2);c.insert(2);
|
||||
c.insert(0);
|
||||
c.insert(1);c.insert(1);
|
||||
c.insert(2);c.insert(2);c.insert(2);c.insert(2);
|
||||
c.insert(3);
|
||||
c.insert(4);c.insert(4);c.insert(4);
|
||||
c.insert(5);c.insert(5);
|
||||
c.insert(6);
|
||||
c.insert(7);
|
||||
size_type num_elems=
|
||||
c.count(0)+c.count(1)+c.count(2)+c.count(3)+
|
||||
c.count(4)+c.count(5)+c.count(6)+c.count(7);
|
||||
|
||||
for(size_type n=c.size();n--;){
|
||||
iterator it=boost::next(c.begin(),n);
|
||||
@ -54,6 +70,18 @@ void test_stable_update(BOOST_EXPLICIT_TEMPLATE_TYPE(MultiIndexContainer))
|
||||
|
||||
c.modify(it,do_nothing(),do_nothing());
|
||||
BOOST_TEST((size_type)std::distance(c.begin(),it)==n);
|
||||
|
||||
for(int i=0;i<=8;++i){
|
||||
MultiIndexContainer cpy(c);
|
||||
bool b=c.modify(it,assign_value(i),assign_value(*it));
|
||||
BOOST_TEST(b||(size_type)std::distance(c.begin(),it)==n);
|
||||
BOOST_TEST(c.count(0)+c.count(1)+c.count(2)+c.count(3)+c.count(4)+
|
||||
c.count(5)+c.count(6)+c.count(7)+c.count(8)==num_elems);
|
||||
if(b){
|
||||
c=cpy;
|
||||
it=boost::next(c.begin(),n);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -148,16 +176,16 @@ void test_update()
|
||||
BOOST_TEST(!iis.modify_key(iis.begin(),increment_int));
|
||||
BOOST_TEST(iis.size()==2);
|
||||
|
||||
nth_index_iterator<int_int_set,1>::type it=ii1.find(5);
|
||||
BOOST_TEST(ii1.modify_key(it,increment_int));
|
||||
BOOST_TEST(ii1.modify_key(it,increment_int));
|
||||
BOOST_TEST(ii1.modify_key(it,increment_int,decrement_int));
|
||||
BOOST_TEST(ii1.modify_key(it,increment_int));
|
||||
nth_index_iterator<int_int_set,1>::type it_=ii1.find(5);
|
||||
BOOST_TEST(ii1.modify_key(it_,increment_int));
|
||||
BOOST_TEST(ii1.modify_key(it_,increment_int));
|
||||
BOOST_TEST(ii1.modify_key(it_,increment_int,decrement_int));
|
||||
BOOST_TEST(ii1.modify_key(it_,increment_int));
|
||||
|
||||
BOOST_TEST(!ii1.modify_key(it,increment_int,decrement_int));
|
||||
BOOST_TEST(!ii1.modify_key(it_,increment_int,decrement_int));
|
||||
BOOST_TEST(ii1.size()==2);
|
||||
|
||||
BOOST_TEST(!ii1.modify_key(it,increment_int));
|
||||
BOOST_TEST(!ii1.modify_key(it_,increment_int));
|
||||
BOOST_TEST(ii1.size()==1);
|
||||
}
|
||||
{
|
||||
@ -214,11 +242,8 @@ void test_update()
|
||||
indexed_by<
|
||||
ordered_non_unique<identity<int> >
|
||||
>
|
||||
> int_set;
|
||||
|
||||
/* MSVC++ 6.0 needs this out-of-template definition */
|
||||
int_set dummy1;
|
||||
test_stable_update<int_set>();
|
||||
> int_multiset;
|
||||
test_stable_update<int_multiset>();
|
||||
|
||||
typedef multi_index_container<
|
||||
int,
|
||||
@ -226,8 +251,6 @@ void test_update()
|
||||
hashed_unique<identity<int> >
|
||||
>
|
||||
> int_hashed_set;
|
||||
|
||||
int_hashed_set dummy2;
|
||||
test_stable_update<int_hashed_set>();
|
||||
|
||||
typedef multi_index_container<
|
||||
@ -236,8 +259,6 @@ void test_update()
|
||||
hashed_unique<identity<int> >
|
||||
>
|
||||
> int_hashed_multiset;
|
||||
|
||||
int_hashed_multiset dummy3;
|
||||
test_stable_update<int_hashed_multiset>();
|
||||
|
||||
typedef multi_index_container<
|
||||
@ -246,8 +267,6 @@ void test_update()
|
||||
hashed_unique<identity<int>,null_hash>
|
||||
>
|
||||
> degenerate_int_hashed_set;
|
||||
|
||||
degenerate_int_hashed_set dummy4;
|
||||
test_stable_update<degenerate_int_hashed_set>();
|
||||
|
||||
typedef multi_index_container<
|
||||
@ -256,8 +275,6 @@ void test_update()
|
||||
hashed_non_unique<identity<int>,null_hash>
|
||||
>
|
||||
> degenerate_int_hashed_multiset;
|
||||
|
||||
degenerate_int_hashed_multiset dummy5;
|
||||
test_stable_update<degenerate_int_hashed_multiset>();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user