• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="utf-8" ?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
7<title>Boost Pointer Container Library</title>
8<meta name="authors" content="Thorsten Ottosen" />
9<meta name="date" content="27th of October 2007" />
10<meta name="copyright" content="Thorsten Ottosen 2004-2007. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt)." />
11<style type="text/css">
12
13/*
14:Author: David Goodger (goodger@python.org)
15:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
16:Copyright: This stylesheet has been placed in the public domain.
17
18Default cascading style sheet for the HTML output of Docutils.
19
20See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
21customize this style sheet.
22*/
23
24/* used to remove borders from tables and images */
25.borderless, table.borderless td, table.borderless th {
26  border: 0 }
27
28table.borderless td, table.borderless th {
29  /* Override padding for "table.docutils td" with "! important".
30     The right padding separates the table cells. */
31  padding: 0 0.5em 0 0 ! important }
32
33.first {
34  /* Override more specific margin styles with "! important". */
35  margin-top: 0 ! important }
36
37.last, .with-subtitle {
38  margin-bottom: 0 ! important }
39
40.hidden {
41  display: none }
42
43.subscript {
44  vertical-align: sub;
45  font-size: smaller }
46
47.superscript {
48  vertical-align: super;
49  font-size: smaller }
50
51a.toc-backref {
52  text-decoration: none ;
53  color: black }
54
55blockquote.epigraph {
56  margin: 2em 5em ; }
57
58dl.docutils dd {
59  margin-bottom: 0.5em }
60
61object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
62  overflow: hidden;
63}
64
65/* Uncomment (and remove this text!) to get bold-faced definition list terms
66dl.docutils dt {
67  font-weight: bold }
68*/
69
70div.abstract {
71  margin: 2em 5em }
72
73div.abstract p.topic-title {
74  font-weight: bold ;
75  text-align: center }
76
77div.admonition, div.attention, div.caution, div.danger, div.error,
78div.hint, div.important, div.note, div.tip, div.warning {
79  margin: 2em ;
80  border: medium outset ;
81  padding: 1em }
82
83div.admonition p.admonition-title, div.hint p.admonition-title,
84div.important p.admonition-title, div.note p.admonition-title,
85div.tip p.admonition-title {
86  font-weight: bold ;
87  font-family: sans-serif }
88
89div.attention p.admonition-title, div.caution p.admonition-title,
90div.danger p.admonition-title, div.error p.admonition-title,
91div.warning p.admonition-title, .code .error {
92  color: red ;
93  font-weight: bold ;
94  font-family: sans-serif }
95
96/* Uncomment (and remove this text!) to get reduced vertical space in
97   compound paragraphs.
98div.compound .compound-first, div.compound .compound-middle {
99  margin-bottom: 0.5em }
100
101div.compound .compound-last, div.compound .compound-middle {
102  margin-top: 0.5em }
103*/
104
105div.dedication {
106  margin: 2em 5em ;
107  text-align: center ;
108  font-style: italic }
109
110div.dedication p.topic-title {
111  font-weight: bold ;
112  font-style: normal }
113
114div.figure {
115  margin-left: 2em ;
116  margin-right: 2em }
117
118div.footer, div.header {
119  clear: both;
120  font-size: smaller }
121
122div.line-block {
123  display: block ;
124  margin-top: 1em ;
125  margin-bottom: 1em }
126
127div.line-block div.line-block {
128  margin-top: 0 ;
129  margin-bottom: 0 ;
130  margin-left: 1.5em }
131
132div.sidebar {
133  margin: 0 0 0.5em 1em ;
134  border: medium outset ;
135  padding: 1em ;
136  background-color: #ffffee ;
137  width: 40% ;
138  float: right ;
139  clear: right }
140
141div.sidebar p.rubric {
142  font-family: sans-serif ;
143  font-size: medium }
144
145div.system-messages {
146  margin: 5em }
147
148div.system-messages h1 {
149  color: red }
150
151div.system-message {
152  border: medium outset ;
153  padding: 1em }
154
155div.system-message p.system-message-title {
156  color: red ;
157  font-weight: bold }
158
159div.topic {
160  margin: 2em }
161
162h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
163h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
164  margin-top: 0.4em }
165
166h1.title {
167  text-align: center }
168
169h2.subtitle {
170  text-align: center }
171
172hr.docutils {
173  width: 75% }
174
175img.align-left, .figure.align-left, object.align-left, table.align-left {
176  clear: left ;
177  float: left ;
178  margin-right: 1em }
179
180img.align-right, .figure.align-right, object.align-right, table.align-right {
181  clear: right ;
182  float: right ;
183  margin-left: 1em }
184
185img.align-center, .figure.align-center, object.align-center {
186  display: block;
187  margin-left: auto;
188  margin-right: auto;
189}
190
191table.align-center {
192  margin-left: auto;
193  margin-right: auto;
194}
195
196.align-left {
197  text-align: left }
198
199.align-center {
200  clear: both ;
201  text-align: center }
202
203.align-right {
204  text-align: right }
205
206/* reset inner alignment in figures */
207div.align-right {
208  text-align: inherit }
209
210/* div.align-center * { */
211/*   text-align: left } */
212
213.align-top    {
214  vertical-align: top }
215
216.align-middle {
217  vertical-align: middle }
218
219.align-bottom {
220  vertical-align: bottom }
221
222ol.simple, ul.simple {
223  margin-bottom: 1em }
224
225ol.arabic {
226  list-style: decimal }
227
228ol.loweralpha {
229  list-style: lower-alpha }
230
231ol.upperalpha {
232  list-style: upper-alpha }
233
234ol.lowerroman {
235  list-style: lower-roman }
236
237ol.upperroman {
238  list-style: upper-roman }
239
240p.attribution {
241  text-align: right ;
242  margin-left: 50% }
243
244p.caption {
245  font-style: italic }
246
247p.credits {
248  font-style: italic ;
249  font-size: smaller }
250
251p.label {
252  white-space: nowrap }
253
254p.rubric {
255  font-weight: bold ;
256  font-size: larger ;
257  color: maroon ;
258  text-align: center }
259
260p.sidebar-title {
261  font-family: sans-serif ;
262  font-weight: bold ;
263  font-size: larger }
264
265p.sidebar-subtitle {
266  font-family: sans-serif ;
267  font-weight: bold }
268
269p.topic-title {
270  font-weight: bold }
271
272pre.address {
273  margin-bottom: 0 ;
274  margin-top: 0 ;
275  font: inherit }
276
277pre.literal-block, pre.doctest-block, pre.math, pre.code {
278  margin-left: 2em ;
279  margin-right: 2em }
280
281pre.code .ln { color: grey; } /* line numbers */
282pre.code, code { background-color: #eeeeee }
283pre.code .comment, code .comment { color: #5C6576 }
284pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
285pre.code .literal.string, code .literal.string { color: #0C5404 }
286pre.code .name.builtin, code .name.builtin { color: #352B84 }
287pre.code .deleted, code .deleted { background-color: #DEB0A1}
288pre.code .inserted, code .inserted { background-color: #A3D289}
289
290span.classifier {
291  font-family: sans-serif ;
292  font-style: oblique }
293
294span.classifier-delimiter {
295  font-family: sans-serif ;
296  font-weight: bold }
297
298span.interpreted {
299  font-family: sans-serif }
300
301span.option {
302  white-space: nowrap }
303
304span.pre {
305  white-space: pre }
306
307span.problematic {
308  color: red }
309
310span.section-subtitle {
311  /* font-size relative to parent (h1..h6 element) */
312  font-size: 80% }
313
314table.citation {
315  border-left: solid 1px gray;
316  margin-left: 1px }
317
318table.docinfo {
319  margin: 2em 4em }
320
321table.docutils {
322  margin-top: 0.5em ;
323  margin-bottom: 0.5em }
324
325table.footnote {
326  border-left: solid 1px black;
327  margin-left: 1px }
328
329table.docutils td, table.docutils th,
330table.docinfo td, table.docinfo th {
331  padding-left: 0.5em ;
332  padding-right: 0.5em ;
333  vertical-align: top }
334
335table.docutils th.field-name, table.docinfo th.docinfo-name {
336  font-weight: bold ;
337  text-align: left ;
338  white-space: nowrap ;
339  padding-left: 0 }
340
341/* "booktabs" style (no vertical lines) */
342table.docutils.booktabs {
343  border: 0px;
344  border-top: 2px solid;
345  border-bottom: 2px solid;
346  border-collapse: collapse;
347}
348table.docutils.booktabs * {
349  border: 0px;
350}
351table.docutils.booktabs th {
352  border-bottom: thin solid;
353  text-align: left;
354}
355
356h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
357h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
358  font-size: 100% }
359
360ul.auto-toc {
361  list-style-type: none }
362
363</style>
364</head>
365<body>
366<div class="document" id="boost-pointer-container-library">
367<h1 class="title"><img alt="Boost" src="boost.png" /> Pointer Container Library</h1>
368<table class="docinfo" frame="void" rules="none">
369<col class="docinfo-name" />
370<col class="docinfo-content" />
371<tbody valign="top">
372<tr><th class="docinfo-name">Authors:</th>
373<td>Thorsten Ottosen</td></tr>
374<tr><th class="docinfo-name">Contact:</th>
375<td><a class="first reference external" href="mailto:nesotto&#64;cs.aau.dk">nesotto&#64;cs.aau.dk</a> or <a class="last reference external" href="mailto:tottosen&#64;dezide.com">tottosen&#64;dezide.com</a></td></tr>
376<tr class="organizations field"><th class="docinfo-name">Organizations:</th><td class="field-body"><a class="reference external" href="http://www.cs.aau.dk">Department of Computer Science</a>, Aalborg University, and <a class="reference external" href="http://www.dezide.com">Dezide Aps</a></td>
377</tr>
378<tr><th class="docinfo-name">Date:</th>
379<td>27th of October 2007</td></tr>
380<tr><th class="docinfo-name">Copyright:</th>
381<td>Thorsten Ottosen 2004-2007. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see <a class="reference external" href="http://www.boost.org/LICENSE_1_0.txt">LICENSE_1_0.txt</a>).</td></tr>
382</tbody>
383</table>
384<div class="section" id="overview">
385<h1>Overview</h1>
386<p>Boost.Pointer Container provides containers for holding heap-allocated
387objects in an exception-safe manner and with minimal overhead.
388The aim of the library is in particular to make OO programming
389easier in C++ by establishing a standard set of classes, methods
390and designs for dealing with OO specific problems</p>
391<ul class="simple">
392<li><a class="reference internal" href="#motivation">Motivation</a></li>
393<li><a class="reference external" href="tutorial.html">Tutorial</a></li>
394<li><a class="reference external" href="reference.html">Reference</a></li>
395<li><a class="reference external" href="guidelines.html">Usage guidelines</a></li>
396<li><a class="reference external" href="examples.html">Examples</a></li>
397<li><a class="reference external" href="headers.html">Library headers</a></li>
398<li><a class="reference external" href="faq.html">FAQ</a></li>
399<li><a class="reference internal" href="#upgrading-from-boost-v-1-33">Upgrading from Boost v. 1.33.*</a></li>
400<li><a class="reference internal" href="#upgrading-from-boost-v-1-34">Upgrading from Boost v. 1.34.*</a></li>
401<li><a class="reference internal" href="#upgrading-from-boost-v-1-35">Upgrading from Boost v. 1.35.*</a></li>
402<li><a class="reference internal" href="#upgrading-from-boost-v-1-66">Upgrading from Boost v. 1.66.*</a></li>
403<li><a class="reference internal" href="#future-developments">Future Developments</a></li>
404<li><a class="reference internal" href="#acknowledgements">Acknowledgements</a></li>
405<li><a class="reference internal" href="#references">References</a></li>
406</ul>
407<!-- - `Conventions <conventions.html>`_
408- `The Clonable Concept <reference.html#the-clonable-concept>`_
409- `The Clone Allocator Concept <reference.html#the-clone-allocator-concept>`_
410- `Pointer container adapters <reference.html#pointer-container-adapters>`_
411- `Sequence container classes <reference.html#sequence-containers>`_
412
413  - `ptr_vector <ptr_vector.html>`_
414  - `ptr_deque <ptr_deque.html>`_
415  - `ptr_list <ptr_list.html>`_
416  - `ptr_array <ptr_array.html>`_
417- `Associative container classes  <reference.html#associative-containers>`_
418
419  - `ptr_set <ptr_set.html>`_
420  - `ptr_multiset <ptr_multiset.html>`_
421  - `ptr_map <ptr_map.html>`_
422  - `ptr_multimap <ptr_multimap.html>`_
423- `Indirected functions <indirect_fun.html>`_
424- `Class nullable <reference.html#class-nullable>`_
425- `Exception classes <reference.html#exception-classes>`_ -->
426</div>
427<div class="section" id="motivation">
428<h1>Motivation</h1>
429<p>Whenever a programmer wants to have a container of pointers to
430heap-allocated objects, there is usually only one exception-safe way:
431to make a container of smart pointers like <a class="reference external" href="../../smart_ptr/shared_ptr.htm">boost::shared_ptr</a>
432This approach is suboptimal if</p>
433<ol class="arabic simple">
434<li>the stored objects are not shared, but owned exclusively, or</li>
435</ol>
436<!--  -->
437<ol class="arabic simple" start="2">
438<li>the overhead implied by smart pointers is inappropriate</li>
439</ol>
440<p>This library therefore provides standard-like containers that are for storing
441heap-allocated or <a class="reference external" href="reference.html#the-clonable-concept">cloned</a> objects (or in case of a map, the mapped object must be
442a heap-allocated or cloned object). For each of the standard
443containers there is a pointer container equivalent that takes ownership of
444the objects in an exception safe manner.  In this respect the library is intended
445to solve the so-called
446<a class="reference external" href="faq.html#what-is-the-polymorphic-class-problem">polymorphic class problem</a>.</p>
447<p>The advantages of pointer containers are</p>
448<ol class="arabic simple">
449<li>Exception-safe pointer storage and manipulation.</li>
450</ol>
451<!--  -->
452<ol class="arabic simple" start="2">
453<li>Notational convenience compared to the use of containers of pointers.</li>
454</ol>
455<!--  -->
456<ol class="arabic simple" start="3">
457<li>Can be used for types that are neither Assignable nor Copy Constructible.</li>
458</ol>
459<!--  -->
460<ol class="arabic simple" start="4">
461<li>No memory-overhead as containers of smart pointers can have (see <a class="footnote-reference" href="#id23" id="id2">[11]</a> and <a class="footnote-reference" href="#id25" id="id3">[12]</a>).</li>
462</ol>
463<!--  -->
464<ol class="arabic simple" start="5">
465<li>Usually faster than using containers of smart pointers (see <a class="footnote-reference" href="#id23" id="id4">[11]</a> and <a class="footnote-reference" href="#id25" id="id5">[12]</a>).</li>
466</ol>
467<!--  -->
468<ol class="arabic simple" start="6">
469<li>The interface is slightly changed towards the domain of pointers
470instead of relying on the normal value-based interface. For example,
471now it is possible for <tt class="docutils literal">pop_back()</tt> to return the removed element.</li>
472</ol>
473<!--  -->
474<ol class="arabic simple" start="7">
475<li>Propagates constness such that one cannot modify the objects via a <tt class="docutils literal">const_iterator</tt>.</li>
476</ol>
477<!--  -->
478<ol class="arabic simple" start="8">
479<li>Built-in support for deep-copy semantics via the <a class="reference external" href="reference.html#the-clonable-concept">the Clonable concept</a></li>
480</ol>
481<p>The disadvantages are</p>
482<ol class="arabic simple">
483<li>Less flexible than containers of smart pointers like <a class="reference external" href="../../smart_ptr/shared_ptr.htm">boost::shared_ptr</a></li>
484</ol>
485<p>When you do need shared semantics, this library is not what you need.</p>
486</div>
487<div class="section" id="upgrading-from-boost-v-1-33">
488<h1>Upgrading from Boost v. <tt class="docutils literal">1.33.*</tt></h1>
489<p>If you upgrade from one of these versions of Boost, then there has been one
490major interface change: map iterators now mimic iterators from <tt class="docutils literal"><span class="pre">std::map</span></tt>.
491Previously you may have written</p>
492<pre class="literal-block">
493for( boost::ptr_map&lt;std::string,T&gt;::iterator i = m.begin(), e = m.end();
494     i != e; ++i )
495{
496  std::cout &lt;&lt; &quot;key:&quot; &lt;&lt; i.key();
497  std::cout &lt;&lt; &quot;value:&quot; &lt;&lt; *i;
498  i-&gt;foo(); // call T::foo()
499}
500</pre>
501<p>and this now needs to be converted into</p>
502<pre class="literal-block">
503for( boost::ptr_map&lt;std::string,T&gt;::iterator i = m.begin(), e = m.end();
504     i != e; ++i )
505{
506  std::cout &lt;&lt; &quot;key:&quot; &lt;&lt; i-&gt;first;
507  std::cout &lt;&lt; &quot;value:&quot; &lt;&lt; *i-&gt;second;
508  i-&gt;second-&gt;foo(); // call T::foo()
509}
510</pre>
511<p>Apart from the above change, the library now also introduces</p>
512<ul>
513<li><p class="first"><tt class="docutils literal"><span class="pre">std::auto_ptr&lt;T&gt;</span></tt> overloads:</p>
514<pre class="literal-block">
515std::auto_ptr&lt;T&gt; p( new T );
516container.push_back( p );
517</pre>
518</li>
519<li><p class="first">Derived-to-Base conversion in <tt class="docutils literal">transfer()</tt>:</p>
520<pre class="literal-block">
521boost::ptr_vector&lt;Base&gt;  vec;
522boost::ptr_list&lt;Derived&gt; list;
523...
524vec.transfer( vec.begin(), list ); // now ok
525</pre>
526</li>
527</ul>
528<p>Also note that <a class="reference external" href="../../assign/index.html">Boost.Assign</a> introduces better support
529for pointer containers.</p>
530</div>
531<div class="section" id="upgrading-from-boost-v-1-34">
532<h1>Upgrading from Boost v. <tt class="docutils literal">1.34.*</tt></h1>
533<p>Serialization has now been made optional thanks to Sebastian Ramacher.
534You simply include <tt class="docutils literal">&lt;boost/ptr_container/serialize.hpp&gt;</tt> or perhaps
535just one of the more specialized headers.</p>
536<p>All containers are now copy-constructible and assignable. So you can e.g. now
537do:</p>
538<pre class="literal-block">
539boost::ptr_vector&lt;Derived&gt; derived = ...;
540boost::ptr_vector&lt;Base&gt;    base( derived );
541base = derived;
542</pre>
543<p>As the example shows, derived-to-base class conversions are also allowed.</p>
544<p>A few general functions have been added:</p>
545<pre class="literal-block">
546VoidPtrContainer&amp;       base();
547const VoidPtrContainer&amp; base() const;
548</pre>
549<p>These allow direct access to the wrapped container which is
550sometimes needed when you want to provide extra functionality.</p>
551<p>A few new functions have been added to sequences:</p>
552<pre class="literal-block">
553void resize( size_type size );
554void resize( size_type size, T* to_clone );
555</pre>
556<p><tt class="docutils literal">ptr_vector&lt;T&gt;</tt> has a few new helper functions to integrate better with C-arrays:</p>
557<pre class="literal-block">
558void transfer( iterator before, T** from, size_type size, bool delete_from = true );
559T**  c_array();
560</pre>
561<p>Finally, you can now also &quot;copy&quot; and &quot;assign&quot; an <tt class="docutils literal">auto_type</tt> ptr by calling <tt class="docutils literal">move()</tt>:</p>
562<pre class="literal-block">
563boost::ptr_vector&lt;T&gt;::auto_type move_ptr = ...;
564return boost::ptr_container::move( move_ptr );
565</pre>
566</div>
567<div class="section" id="upgrading-from-boost-v-1-35">
568<h1>Upgrading from Boost v. <tt class="docutils literal">1.35.*</tt></h1>
569<p>The library has been fairly stable, but a few new containers have been supported:</p>
570<ul class="simple">
571<li><tt class="docutils literal"><span class="pre">boost::ptr_unordered_set&lt;T&gt;</span></tt> in <tt class="docutils literal">&lt;boost/ptr_container/ptr_unordered_set.hpp&gt;</tt></li>
572<li><tt class="docutils literal"><span class="pre">boost::ptr_unordered_map&lt;Key,T&gt;</span></tt> in <tt class="docutils literal">&lt;boost/ptr_container/ptr_unordered_map.hpp&gt;</tt></li>
573<li><tt class="docutils literal"><span class="pre">boost::ptr_circular_buffer&lt;T&gt;</span></tt> in <tt class="docutils literal">&lt;boost/ptr_container/ptr_circular_buffer.hpp&gt;</tt></li>
574</ul>
575<p>There are no docs for these classes yet, but they are almost identical to
576<tt class="docutils literal"><span class="pre">boost::ptr_set&lt;T&gt;</span></tt>, <tt class="docutils literal"><span class="pre">boost::ptr_map&lt;Key,T&gt;</span></tt> and <tt class="docutils literal"><span class="pre">boost::ptr_array&lt;T,N&gt;</span></tt>, respectively.
577The underlying containers stem from the two boost libraries</p>
578<ul class="simple">
579<li><a class="reference external" href="../../unordered/index.html">Boost.Unordered</a></li>
580<li><a class="reference external" href="../../circular_buffer/index.html">Boost.Circular Buffer</a></li>
581</ul>
582<p>Furthermore, <a class="reference external" href="ptr_inserter.html">insert iterators</a> have been added.</p>
583</div>
584<div class="section" id="upgrading-from-boost-v-1-66">
585<h1>Upgrading from Boost v. <tt class="docutils literal">1.66.*</tt></h1>
586<p>Starting with Boost v. <tt class="docutils literal">1.67.0</tt>, Boost.Pointer Container will use
587<a class="reference external" href="../../config/index.html">Boost.Config</a> to conditionally provide
588<tt class="docutils literal"><span class="pre">std::unique_ptr</span></tt>-based interfaces in addition to, or instead of,
589interfaces using <tt class="docutils literal"><span class="pre">std::auto_ptr</span></tt>. Details
590are on the <a class="reference external" href="compatible_smart_ptr.html">Compatible Smart Pointer</a>
591page, which also explains the convention in this documentation of using</p>
592<pre class="literal-block">
593<em>compatible-smart-ptr</em>&lt;T&gt;
594</pre>
595<p>to indicate such conditional interfaces.</p>
596<p>For C++98/03 users, this change has no observable effect.</p>
597<p>For C++11/14 users, there is no effect on existing code that used
598previous versions of Boost.Pointer Container, but now all function
599overloads taking an <tt class="docutils literal"><span class="pre">std::auto_ptr</span></tt> parameter are accompanied by an
600overload taking <tt class="docutils literal"><span class="pre">std::unique_ptr</span></tt>. In the case of return types,
601<tt class="docutils literal"><span class="pre">std::auto_ptr</span></tt> is still always used. Note however that until C++17,
602it is possible to construct <tt class="docutils literal"><span class="pre">std::unique_ptr&lt;T&gt;</span></tt> implicitly from
603<tt class="docutils literal"><span class="pre">std::auto_ptr&lt;T&gt;</span></tt>. Thus, users are free to modernize their code by
604replacing any explicit mention of <tt class="docutils literal"><span class="pre">std::auto_ptr</span></tt> with
605<tt class="docutils literal"><span class="pre">std::unique_ptr</span></tt>. This change falls just short of a
606search-and-replace conversion, as it is possible that some code may
607have relied on <tt class="docutils literal"><span class="pre">std::auto_ptr</span></tt> being copyable. But such situations
608will result in compile-time errors which should be easy to fix.</p>
609<p>Although <tt class="docutils literal"><span class="pre">std::auto_ptr</span></tt> is formally removed as of ISO C++17,
610certain compiler or standard library vendors have chosen to leave it
611in for backwards compatibility. For compilers and standard libraries
612where this is <em>not</em> the case, C++17 compilation of code using
613Boost.Pointer Container is not possible with Boost v. <tt class="docutils literal">1.66.*</tt> or
614earlier. This situation is fixed as of Boost v. <tt class="docutils literal">1.67.0</tt>.</p>
615</div>
616<div class="section" id="future-developments">
617<h1>Future Developments</h1>
618<p>There are indications that the <tt class="docutils literal">void*</tt> implementation has a slight
619performance overhead compared to a <tt class="docutils literal">T*</tt> based implementation. Furthermore, a
620<tt class="docutils literal">T*</tt> based implementation is so much easier to use type-safely
621with algorithms. Therefore I anticipate to move to a <tt class="docutils literal">T*</tt> based implementation.</p>
622<p>Furthermore, the clone allocator might be allowed to have state.
623This design requires some thought, so if you have good ideas and use-cases'
624for this, please don't hesitate to contact me.</p>
625<p>Also, support for Boost.Interprocess is on the todo list.</p>
626<p>There has been a few request for <tt class="docutils literal"><span class="pre">boost::ptr_multi_index_container&lt;T,...&gt;</span></tt>.
627I investigated how difficult it would be, and it did turn out to be difficult, albeit
628not impossible. But I don't have the resources to implement this beast
629for years to come, so if someone really needs this container, I suggest that they
630talk with me in private about how it can be done.</p>
631</div>
632<div class="section" id="acknowledgements">
633<h1>Acknowledgements</h1>
634<p>The following people have been very helpful:</p>
635<ul class="simple">
636<li>Bjørn D. Rasmussen for unintentionally motivating me to start this library</li>
637<li>Pavel Vozenilek for asking me to make the adapters</li>
638<li>David Abrahams for the <tt class="docutils literal">indirect_fun</tt> design</li>
639<li>Pavol Droba for being review manager</li>
640<li>Ross Boylan for trying out a prototype for real</li>
641<li>Felipe Magno de Almeida for giving fedback based on using the
642library in production code even before the library was part of boost</li>
643<li>Jonathan Turkanis for supplying his <tt class="docutils literal">move_ptr</tt> framework
644which is used internally</li>
645<li>Stefan Slapeta and Howard Hinnant for Metrowerks support</li>
646<li>Russell Hind for help with Borland compatibility</li>
647<li>Jonathan Wakely for his great help with GCC compatibility and bug fixes</li>
648<li>Pavel Chikulaev for comments and bug-fixes</li>
649<li>Andreas Hommel for fixing the nasty Metrowerks bug</li>
650<li>Charles Brockman for his many comments on the documentation</li>
651<li>Sebastian Ramacher for implementing the optional serialization support</li>
652</ul>
653</div>
654<div class="section" id="references">
655<h1>References</h1>
656<table class="docutils footnote" frame="void" id="id8" rules="none">
657<colgroup><col class="label" /><col /></colgroup>
658<tbody valign="top">
659<tr><td class="label">[1]</td><td>Matt Austern: <a class="reference external" href="http://www.cuj.com/documents/s=7990/cujcexp1910austern/">&quot;The Standard Librarian: Containers of Pointers&quot;</a> , C/C++ Users Journal Experts Forum.</td></tr>
660</tbody>
661</table>
662<table class="docutils footnote" frame="void" id="id10" rules="none">
663<colgroup><col class="label" /><col /></colgroup>
664<tbody valign="top">
665<tr><td class="label">[2]</td><td>Bjarne Stroustrup, &quot;The C++ Programming Language&quot;, <a class="reference external" href="http://www.research.att.com/~bs/3rd_safe.pdf">Appendix E: &quot;Standard-Library Exception Safety&quot;</a></td></tr>
666</tbody>
667</table>
668<table class="docutils footnote" frame="void" id="id12" rules="none">
669<colgroup><col class="label" /><col /></colgroup>
670<tbody valign="top">
671<tr><td class="label">[3]</td><td>Herb Sutter, &quot;Exceptional C++&quot;.</td></tr>
672</tbody>
673</table>
674<table class="docutils footnote" frame="void" id="id13" rules="none">
675<colgroup><col class="label" /><col /></colgroup>
676<tbody valign="top">
677<tr><td class="label">[4]</td><td>Herb Sutter, &quot;More Exceptional C++&quot;.</td></tr>
678</tbody>
679</table>
680<table class="docutils footnote" frame="void" id="id14" rules="none">
681<colgroup><col class="label" /><col /></colgroup>
682<tbody valign="top">
683<tr><td class="label">[5]</td><td>Kevlin Henney: <a class="reference external" href="http://www.cuj.com/documents/s=7986/cujcexp2002henney/henney.htm">&quot;From Mechanism to Method: The Safe Stacking of Cats&quot;</a> , C++ Experts Forum, February 2002.</td></tr>
684</tbody>
685</table>
686<table class="docutils footnote" frame="void" id="id16" rules="none">
687<colgroup><col class="label" /><col /></colgroup>
688<tbody valign="top">
689<tr><td class="label">[6]</td><td>Some of the few earlier attempts of pointer containers I have seen are the rather interesting <a class="reference external" href="http://www.ntllib.org/asp.html">NTL</a> and the
690<a class="reference external" href="http://ootips.org/yonat/4dev/pointainer.h">pointainer</a>.
691As of this writing both libraries are not exceptions-safe and can leak.</td></tr>
692</tbody>
693</table>
694<table class="docutils footnote" frame="void" id="id17" rules="none">
695<colgroup><col class="label" /><col /></colgroup>
696<tbody valign="top">
697<tr><td class="label">[7]</td><td>INTERNATIONAL STANDARD, Programming languages --- C++, ISO/IEC 14882, 1998. See section 23 in particular.</td></tr>
698</tbody>
699</table>
700<table class="docutils footnote" frame="void" id="id18" rules="none">
701<colgroup><col class="label" /><col /></colgroup>
702<tbody valign="top">
703<tr><td class="label">[8]</td><td>C++ Standard Library Closed Issues List (Revision 27),
704Item 218, <a class="reference external" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-closed.html#218">Algorithms do not use binary predicate objects for default comparisons</a>.</td></tr>
705</tbody>
706</table>
707<table class="docutils footnote" frame="void" id="id20" rules="none">
708<colgroup><col class="label" /><col /></colgroup>
709<tbody valign="top">
710<tr><td class="label">[9]</td><td>C++ Standard Library Active Issues List (Revision 27),
711Item 226, <a class="reference external" href="http://gcc.gnu.org/onlinedocs/libstdc++/ext/lwg-active.html#226">User supplied specializations or overloads of namespace std function templates</a>.</td></tr>
712</tbody>
713</table>
714<table class="docutils footnote" frame="void" id="id22" rules="none">
715<colgroup><col class="label" /><col /></colgroup>
716<tbody valign="top">
717<tr><td class="label">[10]</td><td>Harald Nowak, &quot;A remove_if for vector&quot;, C/C++ Users Journal, July 2001.</td></tr>
718</tbody>
719</table>
720<table class="docutils footnote" frame="void" id="id23" rules="none">
721<colgroup><col class="label" /><col /></colgroup>
722<tbody valign="top">
723<tr><td class="label">[11]</td><td><em>(<a class="fn-backref" href="#id2">1</a>, <a class="fn-backref" href="#id4">2</a>)</em> Boost smart pointer <a class="reference external" href="http://www.boost.org/libs/smart_ptr/smarttests.htm">timings</a></td></tr>
724</tbody>
725</table>
726<table class="docutils footnote" frame="void" id="id25" rules="none">
727<colgroup><col class="label" /><col /></colgroup>
728<tbody valign="top">
729<tr><td class="label">[12]</td><td><em>(<a class="fn-backref" href="#id3">1</a>, <a class="fn-backref" href="#id5">2</a>)</em> <a class="reference external" href="http://www.ntllib.org/asp.html">NTL</a>: Array vs std::vector and boost::shared_ptr</td></tr>
730</tbody>
731</table>
732<table class="docutils footnote" frame="void" id="id26" rules="none">
733<colgroup><col class="label" /><col /></colgroup>
734<tbody valign="top">
735<tr><td class="label">[13]</td><td>Kevlin Henney, <a class="reference external" href="http://www.two-sdg.demon.co.uk/curbralan/papers/europlop/NullObject.pdf">Null Object</a>, 2002.</td></tr>
736</tbody>
737</table>
738<hr><table class="docutils field-list" frame="void" rules="none">
739<col class="field-name" />
740<col class="field-body" />
741<tbody valign="top">
742<tr class="field"><th class="field-name">Copyright:</th><td class="field-body">Thorsten Ottosen 2004-2006.</td>
743</tr>
744</tbody>
745</table>
746</div>
747</div>
748</body>
749</html>
750