summaryrefslogtreecommitdiff
path: root/doc/html/unordered/compliance.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/html/unordered/compliance.html')
-rw-r--r--doc/html/unordered/compliance.html65
1 files changed, 47 insertions, 18 deletions
diff --git a/doc/html/unordered/compliance.html b/doc/html/unordered/compliance.html
index 2244d560f1..8612841e22 100644
--- a/doc/html/unordered/compliance.html
+++ b/doc/html/unordered/compliance.html
@@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
-<title>C++11 Compliance</title>
+<title>Standard Compliance</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
@@ -25,14 +25,23 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="unordered.compliance"></a><a class="link" href="compliance.html" title="C++11 Compliance">C++11 Compliance</a>
+<a name="unordered.compliance"></a><a class="link" href="compliance.html" title="Standard Compliance">Standard Compliance</a>
</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="compliance.html#unordered.compliance.move">Move emulation</a></span></dt>
<dt><span class="section"><a href="compliance.html#unordered.compliance.allocator_compliance">Use of allocators</a></span></dt>
-<dt><span class="section"><a href="compliance.html#unordered.compliance.pairs">Pairs</a></span></dt>
+<dt><span class="section"><a href="compliance.html#unordered.compliance.construction">Construction/Destruction
+ using allocators</a></span></dt>
+<dt><span class="section"><a href="compliance.html#unordered.compliance.pointer_traits">Pointer Traits</a></span></dt>
+<dt><span class="section"><a href="compliance.html#unordered.compliance.pairs0">Pairs</a></span></dt>
<dt><span class="section"><a href="compliance.html#unordered.compliance.misc">Miscellaneous</a></span></dt>
</dl></div>
+<p>
+ The intent of Boost.Unordered is to implement a close (but inperfect) implementation
+ of the C++17 standard, that will work with C++98 upwards. The wide compatibility
+ does mean some comprimises have to be made. With a compiler and library that
+ fully support C++11, the differences should be minor.
+ </p>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="unordered.compliance.move"></a><a class="link" href="compliance.html#unordered.compliance.move" title="Move emulation">Move emulation</a>
@@ -94,26 +103,46 @@
on some compilers and <code class="computeroutput"><span class="identifier">propagate_on_container_move_assignment</span></code>
on others.
</p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="unordered.compliance.construction"></a><a class="link" href="compliance.html#unordered.compliance.construction" title="Construction/Destruction using allocators">Construction/Destruction
+ using allocators</a>
+</h3></div></div></div>
+<p>
+ The following support is required for full use of C++11 style construction/destruction:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
+<li class="listitem">
+ Variadic templates.
+ </li>
+<li class="listitem">
+ Piecewise construction of <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span></code>.
+ </li>
+<li class="listitem">
+ Either <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator_traits</span></code> or expression SFINAE.
+ </li>
+</ul></div>
<p>
- The use of the allocator's construct and destruct methods might be a bit
- surprising. Nodes are constructed and destructed using the allocator, but
- the elements are stored in aligned space within the node and constructed
- and destructed by calling the constructor and destructor directly.
+ This is detected using Boost.Config. The macro <code class="computeroutput"><span class="identifier">BOOST_UNORDERED_CXX11_CONSTRUCTION</span></code>
+ will be set to 1 if it is found, or 0 otherwise.
</p>
<p>
- In C++11 the allocator's construct function has the signature:
+ When this is the case <code class="computeroutput"><span class="identifier">allocator_traits</span><span class="special">::</span><span class="identifier">construct</span></code>
+ and <code class="computeroutput"><span class="identifier">allocator_traits</span><span class="special">::</span><span class="identifier">destroy</span></code> will always be used, apart from
+ when piecewise constructing a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span></code>
+ using <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tuple</span></code> (see <a class="link" href="compliance.html#unordered.compliance.pairs">below</a>),
+ but that should be easily avoided.
</p>
-<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">U</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">Args</span><span class="special">&gt;</span>
-<span class="keyword">void</span> <span class="identifier">construct</span><span class="special">(</span><span class="identifier">U</span><span class="special">*</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">Args</span><span class="special">&amp;&amp;...</span> <span class="identifier">args</span><span class="special">);</span>
-</pre>
<p>
- which supports calling <code class="computeroutput"><span class="identifier">construct</span></code>
- for the contained object, but most existing allocators don't support this.
- If member function detection was good enough then with old allocators it
- would fall back to calling the element's constructor directly but in general,
- detection isn't good enough to do this which is why Boost.Unordered just
- calls the constructor directly every time. In most cases this will work okay.
+ When support is not available <code class="computeroutput"><span class="identifier">allocator_traits</span><span class="special">::</span><span class="identifier">construct</span></code>
+ and <code class="computeroutput"><span class="identifier">allocator_traits</span><span class="special">::</span><span class="identifier">destroy</span></code> are never called.
</p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="unordered.compliance.pointer_traits"></a><a class="link" href="compliance.html#unordered.compliance.pointer_traits" title="Pointer Traits">Pointer Traits</a>
+</h3></div></div></div>
<p>
<code class="computeroutput"><span class="identifier">pointer_traits</span></code> aren't used.
Instead, pointer types are obtained from rebound allocators, this can cause
@@ -124,7 +153,7 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
-<a name="unordered.compliance.pairs"></a><a class="link" href="compliance.html#unordered.compliance.pairs" title="Pairs">Pairs</a>
+<a name="unordered.compliance.pairs0"></a><a name="unordered.compliance.pairs"></a><a class="link" href="compliance.html#unordered.compliance.pairs0" title="Pairs">Pairs</a>
</h3></div></div></div>
<p>
Since the containers use <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span></code>