diff options
Diffstat (limited to 'libstdc++-v3/doc/xml/manual/shared_ptr.xml')
-rw-r--r-- | libstdc++-v3/doc/xml/manual/shared_ptr.xml | 78 |
1 files changed, 12 insertions, 66 deletions
diff --git a/libstdc++-v3/doc/xml/manual/shared_ptr.xml b/libstdc++-v3/doc/xml/manual/shared_ptr.xml index 6e3392f88ee..be1aaf655f2 100644 --- a/libstdc++-v3/doc/xml/manual/shared_ptr.xml +++ b/libstdc++-v3/doc/xml/manual/shared_ptr.xml @@ -95,13 +95,13 @@ until the last weak reference is dropped. <term><classname>_Sp_counted_base_impl<Ptr, Deleter, Lp></classname></term> <listitem> <para> -Inherits from _Sp_counted_base and stores a pointer of type <type>Ptr</type> -and a deleter of type <code>Deleter</code>. <code>_Sp_deleter</code> is +Inherits from _Sp_counted_base and stores a pointer of type <code>Ptr</code> +and a deleter of type <code>Deleter</code>. <classname>_Sp_deleter</classname> is used when the user doesn't supply a custom deleter. Unlike Boost's, this default deleter is not "checked" because GCC already issues a warning if <function>delete</function> is used with an incomplete type. -This is the only derived type used by <classname>shared_ptr<Ptr></classname> -and it is never used by <classname>shared_ptr</classname>, which uses one of +This is the only derived type used by <classname>tr1::shared_ptr<Ptr></classname> +and it is never used by <classname>std::shared_ptr</classname>, which uses one of the following types, depending on how the shared_ptr is constructed. </para> </listitem> @@ -149,11 +149,6 @@ that simplifies the implementation slightly. </variablelist> - </section> - - <section><info><title>Thread Safety</title></info> - - <para> C++11-only features are: rvalue-ref/move support, allocator support, aliasing constructor, make_shared & allocate_shared. Additionally, @@ -161,6 +156,11 @@ the constructors taking <classname>auto_ptr</classname> parameters are deprecated in C++11 mode. </para> + + </section> + + <section><info><title>Thread Safety</title></info> + <para> The <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://boost.org/libs/smart_ptr/shared_ptr.htm#ThreadSafety">Thread @@ -243,7 +243,7 @@ available policies are: <orderedlist> <listitem> <para> - <type>_S_Atomic</type> + <constant>_S_Atomic</constant> </para> <para> Selected when GCC supports a builtin atomic compare-and-swap operation @@ -256,7 +256,7 @@ synchronisation. <listitem> <para> - <type>_S_Mutex</type> + <constant>_S_Mutex</constant> </para> <para> The _Sp_counted_base specialization for this policy contains a mutex, @@ -267,7 +267,7 @@ builtins aren't available so explicit memory barriers are needed in places. <listitem> <para> - <type>_S_Single</type> + <constant>_S_Single</constant> </para> <para> This policy uses a non-reentrant add_ref_lock() with no locking. It is @@ -285,32 +285,6 @@ used when libstdc++ is built without <literal>--enable-threads</literal>. </para> </section> - <section><info><title>Dual C++11 and TR1 Implementation</title></info> - - -<para> -The interface of <classname>tr1::shared_ptr</classname> was extended for C++11 -with support for rvalue-references and the other features from N2351. -The <classname>_Sp_counted_base</classname> base class is implemented in -<filename>tr1/boost_sp_shared_count.h</filename> and is common to the TR1 -and C++11 versions of <classname>shared_ptr</classname>. -</para> - -<para> -The classes derived from <classname>_Sp_counted_base</classname> (see Class Hierarchy -above) and <classname>__shared_count</classname> are implemented separately for C++11 -and TR1, in <filename>bits/shared_ptr.h</filename> and -<filename>tr1/shared_ptr.h</filename> respectively. -</para> - -<para> -The TR1 implementation is considered relatively stable, so is unlikely to -change unless bug fixes require it. If the code that is common to both -C++11 and TR1 versions needs to diverge further then it might be necessary to -duplicate <classname>_Sp_counted_base</classname> and only make changes to -the C++11 version. -</para> -</section> <section><info><title>Related functions and classes</title></info> @@ -377,34 +351,6 @@ be private. </section> -<!--- XXX - <listitem> - <type>_Sp_counted_base<Lp></type> - <para> -The base of the hierarchy is parameterized on the lock policy alone. -_Sp_counted_base doesn't depend on the type of pointer being managed, -it only maintains the reference counts and calls virtual functions when -the counts drop to zero. The managed object is destroyed when the last -strong reference is dropped, but the _Sp_counted_base itself must exist -until the last weak reference is dropped. - </para> - </listitem> - - <listitem> - <type>_Sp_counted_base_impl<Ptr, Deleter, Lp></type> - <para> -Inherits from _Sp_counted_base and stores a pointer of type <code>Ptr</code> -and a deleter of type <code>Deleter</code>. <code>_Sp_deleter</code> is -used when the user doesn't supply a custom deleter. Unlike Boost's, this -default deleter is not "checked" because GCC already issues a warning if -<code>delete</code> is used with an incomplete type. -This is the only derived type used by <code>tr1::shared_ptr<Ptr></code> -and it is never used by <code>std::shared_ptr</code>, which uses one of -the following types, depending on how the shared_ptr is constructed. - </para> - </listitem> ---> - <section xml:id="shared_ptr.using"><info><title>Use</title></info> |