pdf ;
+explicit pdf_ ;
+
+###############################################################################
+alias boostdoc ;
+explicit boostdoc ;
+alias boostrelease : html_ ;
+explicit boostrelease ;
diff --git a/doc/asciidoctor.jam b/doc/asciidoctor.jam
new file mode 100644
index 0000000..488670d
--- /dev/null
+++ b/doc/asciidoctor.jam
@@ -0,0 +1,50 @@
+# Copyright 2017 Peter Dimov
+#
+# 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)
+
+import type ;
+import scanner ;
+import generators ;
+import boostbook ;
+
+# File type
+
+type.register ASCIIDOC : asciidoc adoc ;
+
+# Define dependency scanner
+
+class asciidoc-scanner : common-scanner
+{
+ rule pattern ( )
+ {
+ return "include::([^[]+)\\[" ;
+ }
+}
+
+scanner.register asciidoc-scanner : include ;
+type.set-scanner ASCIIDOC : asciidoc-scanner ;
+
+# Define generators
+
+generators.register-standard asciidoctor.asciidoc-to-html : ASCIIDOC : HTML ;
+generators.register-standard asciidoctor.asciidoc-to-pdf : ASCIIDOC : PDF ;
+# generators.register-standard asciidoctor.asciidoc-to-docbook : ASCIIDOC : DOCBOOK ;
+
+# Define actions
+
+actions asciidoc-to-html
+{
+ asciidoctor -b html -o $(1) $(2)
+}
+
+actions asciidoc-to-pdf
+{
+ asciidoctor -r asciidoctor-pdf -b pdf -o $(1) $(2)
+}
+
+actions asciidoc-to-docbook
+{
+ asciidoctor -b docbook -o $(1) $(2)
+}
diff --git a/doc/smart_ptr-docinfo-footer.html b/doc/smart_ptr-docinfo-footer.html
new file mode 100644
index 0000000..8cf495c
--- /dev/null
+++ b/doc/smart_ptr-docinfo-footer.html
@@ -0,0 +1,33 @@
+
+
+
diff --git a/doc/smart_ptr.adoc b/doc/smart_ptr.adoc
new file mode 100644
index 0000000..e85479b
--- /dev/null
+++ b/doc/smart_ptr.adoc
@@ -0,0 +1,70 @@
+////
+Copyright 2017 Peter Dimov
+
+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
+////
+
+# Boost.SmartPtr: Smart Pointer Library
+Greg Colvin, Beman Dawes, Peter Dimov, Glen Fernandes
+:toc: left
+:toclevels: 3
+:idprefix:
+:listing-caption: Code Example
+:table-caption: Illustration
+:docinfo: private-footer
+
+:leveloffset: +1
+
+include::smart_ptr/introduction.adoc[]
+
+include::smart_ptr/scoped_ptr.adoc[]
+
+include::smart_ptr/scoped_array.adoc[]
+
+include::smart_ptr/shared_ptr.adoc[]
+
+include::smart_ptr/weak_ptr.adoc[]
+
+include::smart_ptr/make_shared.adoc[]
+
+include::smart_ptr/enable_shared_from_this.adoc[]
+
+include::smart_ptr/make_unique.adoc[]
+
+include::smart_ptr/intrusive_ptr.adoc[]
+
+include::smart_ptr/intrusive_ref_counter.adoc[]
+
+include::smart_ptr/pointer_cast.adoc[]
+
+include::smart_ptr/pointer_to_other.adoc[]
+
+// appendix
+include::smart_ptr/techniques.adoc[]
+
+// appendix
+include::smart_ptr/history.adoc[]
+
+// appendix, deprecated
+include::smart_ptr/shared_array.adoc[]
+
+:leveloffset: -1
+
+[appendix]
+## Copyright and License
+
+This documentation is
+
+* Copyright 1999 Greg Colvin
+* Copyright 1999 Beman Dawes
+* Copyright 2002 Darin Adler
+* Copyright 2003-2017 Peter Dimov
+* Copyright 2005, 2006 Ion Gaztañaga
+* Copyright 2008 Frank Mori Hess
+* Copyright 2012-2017 Glen Fernandes
+* Copyright 2013 Andrey Semashev
+
+and is distributed under the http://www.boost.org/LICENSE_1_0.txt[Boost Software License, Version 1.0].
diff --git a/doc/smart_ptr/enable_shared_from_this.adoc b/doc/smart_ptr/enable_shared_from_this.adoc
new file mode 100644
index 0000000..5b385cb
--- /dev/null
+++ b/doc/smart_ptr/enable_shared_from_this.adoc
@@ -0,0 +1,15 @@
+////
+Copyright 2017 Peter Dimov
+
+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
+////
+
+[#enable_shared_from_this]
+# enable_shared_from_this
+:toc:
+:toc-title:
+:idprefix:
+
diff --git a/doc/smart_ptr/history.adoc b/doc/smart_ptr/history.adoc
new file mode 100644
index 0000000..ffdb9af
--- /dev/null
+++ b/doc/smart_ptr/history.adoc
@@ -0,0 +1,89 @@
+////
+Copyright 1999 Greg Colvin and Beman Dawes
+Copyright 2002 Darin Adler
+Copyright 2017 Peter Dimov
+
+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
+////
+
+[appendix,#history]
+# History and Acknowledgments
+:idprefix:
+
+## Summer 1994
+
+Greg Colvin http://www.open-std.org/jtc1/sc22/wg21/docs/papers/1994/N0555.pdf[proposed]
+to the {cpp} Standards Committee classes named `auto_ptr` and `counted_ptr` which were very
+similar to what we now call `scoped_ptr` and `shared_ptr`. In one of the very few cases
+where the Library Working Group's recommendations were not followed by the full committee,
+`counted_ptr` was rejected and surprising transfer-of-ownership semantics were added to `auto_ptr`.
+
+## October 1998
+
+Beman Dawes proposed reviving the original semantics under the names `safe_ptr` and `counted_ptr`,
+meeting of Per Andersson, Matt Austern, Greg Colvin, Sean Corfield, Pete Becker, Nico Josuttis,
+Dietmar Kühl, Nathan Myers, Chichiang Wan and Judy Ward. During the discussion, the four new class
+names were finalized, it was decided that there was no need to exactly follow the `std::auto_ptr`
+interface, and various function signatures and semantics were finalized.
+
+Over the next three months, several implementations were considered for `shared_ptr`, and discussed
+on the http://www.boost.org/[boost.org] mailing list. The implementation questions revolved around
+the reference count which must be kept, either attached to the pointed to object, or detached elsewhere.
+Each of those variants have themselves two major variants:
+
+* Direct detached: the `shared_ptr` contains a pointer to the object, and a pointer to the count.
+* Indirect detached: the `shared_ptr` contains a pointer to a helper object, which in turn contains a pointer to the object and the count.
+* Embedded attached: the count is a member of the object pointed to.
+* Placement attached: the count is attached via operator new manipulations.
+
+Each implementation technique has advantages and disadvantages. We went so far as to run various timings
+of the direct and indirect approaches, and found that at least on Intel Pentium chips there was very little
+measurable difference. Kevlin Henney provided a paper he wrote on "Counted Body Techniques." Dietmar Kühl
+suggested an elegant partial template specialization technique to allow users to choose which implementation
+they preferred, and that was also experimented with.
+
+But Greg Colvin and Jerry Schwarz argued that "parameterization will discourage users", and in the end we choose
+to supply only the direct implementation.
+
+## May 1999
+
+In April and May, 1999, Valentin Bonnard and David Abrahams made a number of suggestions resulting in numerous improvements.
+
+## September 1999
+
+Luis Coelho provided `shared_ptr::swap` and `shared_array::swap`.
+
+## November 1999
+
+Darin Adler provided `operator ==`, `operator !=`, and `std::swap` and `std::less` specializations for shared types.
+
+## May 2001
+
+Vladimir Prus suggested requiring a complete type on destruction. Refinement evolved in discussions including Dave Abrahams,
+Greg Colvin, Beman Dawes, Rainer Deyke, Peter Dimov, John Maddock, Vladimir Prus, Shankar Sai, and others.
+
+## January 2002
+
+Peter Dimov reworked all four classes, adding features, fixing bugs, splitting them into four separate headers, and adding
+`weak_ptr`.
+
+## November 2012
+
+Glen Fernandes provided implementations of `make_shared` and `allocate_shared` for arrays. They achieve a single allocation
+for an array that can be initialized with constructor arguments or initializer lists as well as overloads for default initialization
+and no value initialization.
+
+## February 2014
+
+Glen Fernandes updated overloads of `make_shared` and `allocate_shared` to conform to the specification in {cpp} standard paper
+http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3870.html[N3870],
+and implemented `make_unique` for arrays and objects. Peter Dimov and Glen Fernandes updated the scalar and array implementations,
+respectively, to resolve {cpp} standard library defect 2070.
+
+## February 2017
+
+Glen Fernandes rewrote `allocate_shared` and `make_shared` for arrays for a more optimal and more maintainable implementation.
+
diff --git a/doc/smart_ptr/introduction.adoc b/doc/smart_ptr/introduction.adoc
new file mode 100644
index 0000000..dec424e
--- /dev/null
+++ b/doc/smart_ptr/introduction.adoc
@@ -0,0 +1,49 @@
+////
+Copyright 1999 Greg Colvin and Beman Dawes
+Copyright 2002 Darin Adler
+Copyright 2017 Peter Dimov
+
+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
+////
+
+[#introduction]
+# Introduction
+:toc:
+:toc-title:
+:idprefix:
+
+Smart pointers are objects which store pointers to dynamically allocated (heap) objects.
+They behave much like built-in {cpp} pointers except that they automatically delete the object
+pointed to at the appropriate time. Smart pointers are particularly useful in the face of
+exceptions as they ensure proper destruction of dynamically allocated objects. They can also be
+used to keep track of dynamically allocated objects shared by multiple owners.
+
+Conceptually, smart pointers are seen as owning the object pointed to, and thus responsible for
+deletion of the object when it is no longer needed. As such, they are examples of the "resource
+acquisition is initialization" idiom described in Bjarne Stroustrup's "The C++ Programming Language",
+3rd edition, Section 14.4, Resource Management.
+
+This library provides five smart pointer class templates:
+
+* `scoped_ptr`, used to contain ownership of a dynamically allocated object to the current scope;
+* `scoped_array`, which provides scoped ownership for a dynamically allocated array;
+* `shared_ptr`, a versatile tool for managing shared ownership of an object or array;
+* `weak_ptr`, a non-owning observer to a shared_ptr-managed object that can be promoted temporarily to shared_ptr;
+* `intrusive_ptr`, a pointer to objects with an embedded reference count.
+
+`shared_ptr` and `weak_ptr` are part of the {cpp} standard since its 2011 iteration.
+
+In addition, the library contains the following supporting utility functions and classes:
+
+* `make_shared`, a factory function for creating objects that returns a `shared_ptr`;
+* `make_unique`, a factory function returning `std::unique_ptr`;
+* `enable_shared_from_this`, a helper base class that enables the acquisition of a `shared_ptr` pointing to `this`;
+* `pointer_to_other`, a helper trait for converting one smart pointer type to another;
+* `static_pointer_cast` and companions, generic smart pointer casts;
+* `intrusive_ref_counter`, a helper base class containing a reference count.
+
+As a general rule, the destructor or `operator delete` for an object managed by pointers in the library
+are not allowed to throw exceptions.
diff --git a/doc/smart_ptr/intrusive_ptr.adoc b/doc/smart_ptr/intrusive_ptr.adoc
new file mode 100644
index 0000000..6bf4843
--- /dev/null
+++ b/doc/smart_ptr/intrusive_ptr.adoc
@@ -0,0 +1,15 @@
+////
+Copyright 2017 Peter Dimov
+
+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
+////
+
+[#intrusive_ptr]
+# intrusive_ptr
+:toc:
+:toc-title:
+:idprefix:
+
diff --git a/doc/smart_ptr/intrusive_ref_counter.adoc b/doc/smart_ptr/intrusive_ref_counter.adoc
new file mode 100644
index 0000000..4a9885a
--- /dev/null
+++ b/doc/smart_ptr/intrusive_ref_counter.adoc
@@ -0,0 +1,15 @@
+////
+Copyright 2017 Peter Dimov
+
+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
+////
+
+[#intrusive_ref_counter]
+# intrusive_ref_counter
+:toc:
+:toc-title:
+:idprefix:
+
diff --git a/doc/smart_ptr/make_shared.adoc b/doc/smart_ptr/make_shared.adoc
new file mode 100644
index 0000000..2531cfe
--- /dev/null
+++ b/doc/smart_ptr/make_shared.adoc
@@ -0,0 +1,15 @@
+////
+Copyright 2017 Peter Dimov
+
+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
+////
+
+[#make_shared]
+# make_shared
+:toc:
+:toc-title:
+:idprefix:
+
diff --git a/doc/smart_ptr/make_unique.adoc b/doc/smart_ptr/make_unique.adoc
new file mode 100644
index 0000000..9cfec90
--- /dev/null
+++ b/doc/smart_ptr/make_unique.adoc
@@ -0,0 +1,15 @@
+////
+Copyright 2017 Peter Dimov
+
+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
+////
+
+[#make_unique]
+# make_unique
+:toc:
+:toc-title:
+:idprefix:
+
diff --git a/doc/smart_ptr/pointer_cast.adoc b/doc/smart_ptr/pointer_cast.adoc
new file mode 100644
index 0000000..3041eeb
--- /dev/null
+++ b/doc/smart_ptr/pointer_cast.adoc
@@ -0,0 +1,15 @@
+////
+Copyright 2017 Peter Dimov
+
+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
+////
+
+[#pointer_cast]
+# Generic Pointer Casts
+:toc:
+:toc-title:
+:idprefix:
+
diff --git a/doc/smart_ptr/pointer_to_other.adoc b/doc/smart_ptr/pointer_to_other.adoc
new file mode 100644
index 0000000..4c4f74d
--- /dev/null
+++ b/doc/smart_ptr/pointer_to_other.adoc
@@ -0,0 +1,15 @@
+////
+Copyright 2017 Peter Dimov
+
+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
+////
+
+[#pointer_to_other]
+# pointer_to_other
+:toc:
+:toc-title:
+:idprefix:
+
diff --git a/doc/smart_ptr/scoped_array.adoc b/doc/smart_ptr/scoped_array.adoc
new file mode 100644
index 0000000..9374caa
--- /dev/null
+++ b/doc/smart_ptr/scoped_array.adoc
@@ -0,0 +1,15 @@
+////
+Copyright 2017 Peter Dimov
+
+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
+////
+
+[#scoped_array]
+# scoped_array
+:toc:
+:toc-title:
+:idprefix:
+
diff --git a/doc/smart_ptr/scoped_ptr.adoc b/doc/smart_ptr/scoped_ptr.adoc
new file mode 100644
index 0000000..ba71827
--- /dev/null
+++ b/doc/smart_ptr/scoped_ptr.adoc
@@ -0,0 +1,15 @@
+////
+Copyright 2017 Peter Dimov
+
+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
+////
+
+[#scoped_ptr]
+# scoped_ptr
+:toc:
+:toc-title:
+:idprefix:
+
diff --git a/doc/smart_ptr/shared_array.adoc b/doc/smart_ptr/shared_array.adoc
new file mode 100644
index 0000000..564747f
--- /dev/null
+++ b/doc/smart_ptr/shared_array.adoc
@@ -0,0 +1,15 @@
+////
+Copyright 2017 Peter Dimov
+
+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
+////
+
+[appendix,#shared_array]
+# shared_array (deprecated)
+:toc:
+:toc-title:
+:idprefix:
+
diff --git a/doc/smart_ptr/shared_ptr.adoc b/doc/smart_ptr/shared_ptr.adoc
new file mode 100644
index 0000000..50e38a0
--- /dev/null
+++ b/doc/smart_ptr/shared_ptr.adoc
@@ -0,0 +1,15 @@
+////
+Copyright 2017 Peter Dimov
+
+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
+////
+
+[#shared_ptr]
+# shared_ptr
+:toc:
+:toc-title:
+:idprefix:
+
diff --git a/doc/smart_ptr/techniques.adoc b/doc/smart_ptr/techniques.adoc
new file mode 100644
index 0000000..13a9b18
--- /dev/null
+++ b/doc/smart_ptr/techniques.adoc
@@ -0,0 +1,15 @@
+////
+Copyright 2017 Peter Dimov
+
+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
+////
+
+[appendix,#techniques]
+# Smart Pointer Programming Techniques
+:toc:
+:toc-title:
+:idprefix:
+
diff --git a/doc/smart_ptr/weak_ptr.adoc b/doc/smart_ptr/weak_ptr.adoc
new file mode 100644
index 0000000..ceb28cf
--- /dev/null
+++ b/doc/smart_ptr/weak_ptr.adoc
@@ -0,0 +1,15 @@
+////
+Copyright 2017 Peter Dimov
+
+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
+////
+
+[#weak_ptr]
+# weak_ptr
+:toc:
+:toc-title:
+:idprefix:
+
diff --git a/enable_shared_from_this.html b/enable_shared_from_this.html
deleted file mode 100644
index f04f312..0000000
--- a/enable_shared_from_this.html
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
- enable_shared_from_this
-
-
-
-
enable_shared_from_this
-
-
- The header <boost/enable_shared_from_this.hpp>
defines
- the class template enable_shared_from_this
. It is used as a
- base class that allows a shared_ptr or
- a weak_ptr to the current object to be obtained
- from within a member function.
-
- enable_shared_from_this<T>
defines two member functions
- called shared_from_this
that return a shared_ptr<T>
- and shared_ptr<T const>
, depending on constness, to this
.
- It also defines two member functions called weak_from_this
that return
- a corresponding weak_ptr
.
-
-
-
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
-#include <cassert>
-
-class Y: public boost::enable_shared_from_this<Y>
-{
-public:
-
- boost::shared_ptr<Y> f()
- {
- return shared_from_this();
- }
-};
-
-int main()
-{
- boost::shared_ptr<Y> p(new Y);
- boost::shared_ptr<Y> q = p->f();
- assert(p == q);
- assert(!(p < q || q < p)); // p and q must share ownership
-}
-
-
-
-namespace boost
-{
-
-template<class T> class enable_shared_from_this
-{
-public:
-
- shared_ptr<T> shared_from_this();
- shared_ptr<T const> shared_from_this() const;
-
- weak_ptr<T> weak_from_this() noexcept;
- weak_ptr<T const> weak_from_this() const noexcept;
-}
-
-}
-
- template<class T> shared_ptr<T>
- enable_shared_from_this<T>::shared_from_this();
- template<class T> shared_ptr<T const>
- enable_shared_from_this<T>::shared_from_this() const;
-
-
- Requires: enable_shared_from_this<T>
must be an
- accessible base class of T
. *this
must be a subobject
- of an instance t
of type T
.
-
-
- Returns: If a shared_ptr
instance p
that owns
- t
exists, a shared_ptr<T>
instance r
that shares
- ownership with p
.
-
-
- Postconditions: r.get() == this
.
-
-
- Throws: bad_weak_ptr
when no shared_ptr
owns *this
.
-
-
- template<class T> weak_ptr<T>
- enable_shared_from_this<T>::weak_from_this() noexcept;
- template<class T> weak_ptr<T const>
- enable_shared_from_this<T>::weak_from_this() const noexcept;
-
-
- Requires: enable_shared_from_this<T>
must be an
- accessible base class of T
. *this
must be a subobject
- of an instance t
of type T
.
-
-
- Returns: If a shared_ptr
instance p
that owns
- t
exists or has existed in the past, a weak_ptr<T>
instance
- r
that shares ownership with p
. Otherwise, an empty weak_ptr
.
-
-
-
-
- Copyright © 2002, 2003, 2015 by Peter Dimov. 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.
-
-
diff --git a/gccspeed.gif b/gccspeed.gif
deleted file mode 100644
index d78c06b..0000000
Binary files a/gccspeed.gif and /dev/null differ
diff --git a/index.html b/index.html
index 0551e3c..7afe664 100644
--- a/index.html
+++ b/index.html
@@ -1,13 +1,13 @@
-
+
-Smart Pointers
-
-
+
-
+
+
Automatic redirection failed, please go to
-smart_ptr.htm.
+doc/html/smart_ptr.html.
+
>(std::allocator<int>(), 8);
-
-
-
-
template<class T, class A>
shared_ptr<T>
-allocate_shared(const A& a);
-
-- Returns:
-- A
shared_ptr
to a value-initialized object of type
-E[N]
.
-- Remarks:
-- This overload shall only participate in overload resolution when
-
T
is of the form E[N]
.
-- Example:
-boost::allocate_shared<int[8]>(std::allocator<int>());
-
-
-
-
template<class T, class A>
shared_ptr<T>
-allocate_shared(const A& a, std::size_t n,
-const E& v);
-
-- Returns:
-- A
shared_ptr
to an object of type
-E[size]
, where each array element of type E
is
-initialized to v
.
-- Remarks:
-- This overload shall only participate in overload resolution when
-
T
is of the form E[]
.
-- Example:
-boost::allocate_shared<double[]>(std::allocator<double>(), 8, 1.0);
-
-
-
-
template<class T, class A>
shared_ptr<T>
-allocate_shared(const A& a, const E& v);
-
-- Returns:
-- A
shared_ptr
to an object of type E[N]
,
-where each array element of type E
is initialized to
-v
.
-- Remarks:
-- This overload shall only participate in overload resolution when
-
T
is of the form E[N]
.
-- Example:
-boost::allocate_shared<double[8]>(std::allocator<double>(), 1.0);
-
-
-
-
template<class T, class A>
shared_ptr<T>
-allocate_shared_noinit(const A& a, std::size_t n);
-
-- Returns:
-- A
shared_ptr
to a default-initialized object of type
-E[size]
.
-- Remarks:
-- This overload shall only participate in overload resolution when
-
T
is of the form E[]
.
-- Example:
-boost::allocate_shared_noinit<int[]>(std::allocator<int>(), 8);
-
-
-
-
template<class T, class A>
shared_ptr<T>
-allocate_shared_noinit(const A& a);
-
-- Returns:
-- A
shared_ptr
to a default-initialized object of type
-E[N]
.
-- Remarks:
-- This overload shall only participate in overload resolution when
-
T
is of the form E[N]
.
-- Example:
-boost::allocate_shared_noinit<int[8]>(std::allocator<int>());
-
-
-
-
template<class T>
shared_ptr<T>
-make_shared(std::size_t n);
-
-- Returns:
-allocate_shared<T>(std::allocator<S>(), n);
-- Remarks:
-- This overload shall only participate in overload resolution when
-
T
is of the form E[]
.
-- Example:
-boost::make_shared<int[]>(8);
-
-
-
-
template<class T>
shared_ptr<T>
-make_shared();
-
-- Returns:
-allocate_shared<T>(std::allocator<S>());
-- Remarks:
-- This overload shall only participate in overload resolution when
-
T
is of the form E[N]
.
-- Example:
-boost::make_shared<int[8]>();
-
-
-
-
template<class T>
shared_ptr<T>
-make_shared(std::size_t n, const E& v);
-
-- Returns:
-allocate_shared<T>(std::allocator<S>(), n, v);
-- Remarks:
-- This overload shall only participate in overload resolution when
-
T
is of the form E[]
.
-- Example:
-boost::make_shared<double[]>(8, 1.0);
-
-
-
-
template<class T>
shared_ptr<T>
-make_shared(const E& v);
-
-- Returns:
-allocate_shared<T>(std::allocator<S>(), v);
-- Remarks:
-- This overload shall only participate in overload resolution when
-
T
is of the form E[N].
-- Example:
-boost::make_shared<double[8]>(1.0);
-
-
-
template<class T>
shared_ptr<T>
-make_shared_noinit(std::size_t n);
-
-- Returns:
-allocate_shared_noinit<T>(std::allocator<S>(), n);
-- Remarks:
-- This overload shall only participate in overload resolution when
-
T
is of the form E[]
.
-- Example:
-boost::make_shared_noinit<int[]>(8);
-
-
-
-
template<class T>
shared_ptr<T>
-make_shared_noinit();
-
-- Returns:
-allocate_shared_noinit<T>(std::allocator<S>());
-- Remarks:
-- This overload shall only participate in overload resolution when
-
T
is of the form E[N]
.
-- Example:
-boost::make_shared_noinit<int[8]>();
-
-
-
-
-
History
-
-- Boost 1.64
-- Glen Fernandes rewrote allocate_shared and make_shared for a more
-optimal and more maintainable implementation.
-- Boost 1.56
-- Glen Fernandes updated overloads of make_shared and allocate_shared
-to conform to the specification in C++ standard paper
-N3870, including resolving C++ standard library
-defect report DR 2070.
-- Boost 1.53
-- Glen Fernandes contributed implementations of make_shared and
-allocate_shared for arrays.
-
-
-
-
-Copyright 2012-2017 Glen Fernandes. Distributed under the
-Boost Software License,
-Version 1.0.
-
-