mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Removed references to old smart pointers from the docs.
This commit is contained in:
parent
65aad55748
commit
fa94cdfa96
@ -80,14 +80,6 @@
|
||||
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<name>Smart Pointers</name>
|
||||
<item>scoped_ptr</item>
|
||||
<item>shared_ptr</item>
|
||||
<item>shared_ptr_thread_safe</item>
|
||||
<item>weak_ptr</item>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<name>Interfaces</name>
|
||||
<item>map_pair</item>
|
||||
@ -482,29 +474,6 @@
|
||||
</component>
|
||||
|
||||
|
||||
<!-- ************************************************************************* -->
|
||||
|
||||
<component>
|
||||
<name>weak_ptr</name>
|
||||
<file>dlib/smart_pointers.h</file>
|
||||
<spec_file>dlib/smart_pointers/weak_ptr_abstract.h</spec_file>
|
||||
<description>
|
||||
<p>
|
||||
The weak_ptr class template stores a weak reference to an object that is
|
||||
already managed by a shared_ptr. To access the object, a weak_ptr can
|
||||
be converted to a shared_ptr using the member function lock().
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This is an implementation of the std::tr1::weak_ptr template from the
|
||||
document ISO/IEC PDTR 19768, Proposed Draft Technical Report on C++
|
||||
Library Extensions. The only deviation from that document is that this
|
||||
shared_ptr is declared inside the dlib namespace rather than std::tr1.
|
||||
</p>
|
||||
</description>
|
||||
|
||||
</component>
|
||||
|
||||
<!-- ************************************************************************* -->
|
||||
|
||||
<component>
|
||||
@ -619,45 +588,6 @@
|
||||
</description>
|
||||
</component>
|
||||
|
||||
<!-- ************************************************************************* -->
|
||||
|
||||
|
||||
<component>
|
||||
<name>shared_ptr_thread_safe</name>
|
||||
<file>dlib/smart_pointers_thread_safe.h</file>
|
||||
<spec_file>dlib/smart_pointers/shared_ptr_thread_safe_abstract.h</spec_file>
|
||||
<description>
|
||||
<p>
|
||||
This object represents a reference counted smart pointer just like
|
||||
<a href="#shared_ptr">shared_ptr</a> except that it is threadsafe.
|
||||
</p>
|
||||
</description>
|
||||
|
||||
</component>
|
||||
|
||||
<!-- ************************************************************************* -->
|
||||
<component>
|
||||
<name>shared_ptr</name>
|
||||
<file>dlib/smart_pointers.h</file>
|
||||
<spec_file>dlib/smart_pointers/shared_ptr_abstract.h</spec_file>
|
||||
<description>
|
||||
<p>
|
||||
This object represents a reference counted smart pointer. Each shared_ptr
|
||||
contains a pointer to some object and when the last shared_ptr that points
|
||||
to the object is destructed or reset() then the object is guaranteed to be
|
||||
deleted.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This is an implementation of the std::tr1::shared_ptr template from the
|
||||
document ISO/IEC PDTR 19768, Proposed Draft Technical Report on C++
|
||||
Library Extensions. The only deviation from that document is that this
|
||||
shared_ptr is declared inside the dlib namespace rather than std::tr1.
|
||||
</p>
|
||||
</description>
|
||||
|
||||
</component>
|
||||
|
||||
<!-- ************************************************************************* -->
|
||||
|
||||
<component>
|
||||
@ -698,23 +628,6 @@
|
||||
|
||||
<!-- ************************************************************************* -->
|
||||
|
||||
<component>
|
||||
<name>scoped_ptr</name>
|
||||
<file>dlib/smart_pointers.h</file>
|
||||
<spec_file>dlib/smart_pointers/scoped_ptr_abstract.h</spec_file>
|
||||
<description>
|
||||
This is a implementation of the scoped_ptr class found in the Boost C++
|
||||
library. It is a simple smart pointer class which guarantees that the
|
||||
pointer contained within it will always be deleted.
|
||||
|
||||
The class does not permit copying and so does not do any kind of
|
||||
reference counting. Thus it is very simple and quite fast.
|
||||
</description>
|
||||
|
||||
</component>
|
||||
|
||||
<!-- ************************************************************************* -->
|
||||
|
||||
<component checked="true">
|
||||
<name>graph</name>
|
||||
<file>dlib/graph.h</file>
|
||||
|
@ -215,7 +215,7 @@
|
||||
instead.</h3>
|
||||
<ul><p>
|
||||
You should not be calling new and delete in your own code. You should instead
|
||||
be using objects like the std::vector, <a href="containers.html#scoped_ptr">scoped_ptr</a>,
|
||||
be using objects like the std::vector, std::shared_ptr,
|
||||
or any number of other objects that manage resources such as memory for you. If you want
|
||||
an array use std::vector (or the checked <a href="containers.html#std_vector_c">std_vector_c</a>).
|
||||
If you want to make a lookup table use a <a href="containers.html#map">map</a>. If you want
|
||||
@ -234,7 +234,7 @@
|
||||
to use the <a href="api.html#auto_mutex">auto_mutex</a> which will lock a mutex and automatically
|
||||
unlock it for you. Or suppose you have made a TCP <a href="api.html#sockets">connection</a>
|
||||
to another machine and you want to be certain the resources associated with that connection
|
||||
are always released. You can easily accomplish this with RAII by using the scoped_ptr as
|
||||
are always released. You can easily accomplish this with RAII by using the std::unique_ptr as
|
||||
shown in <a href="sockstreambuf_ex.cpp.html">this</a> example program.
|
||||
</p>
|
||||
<p>
|
||||
@ -271,7 +271,7 @@ double compute_sum_of_array_elements(const std::vector<double>& array)
|
||||
</p>
|
||||
<p>
|
||||
If you absolutely need pointer semantics then you can usually use a smart pointer like
|
||||
<a href="containers.html#scoped_ptr">scoped_ptr</a> or <a href="containers.html#shared_ptr">shared_ptr</a>.
|
||||
std::unique_ptr or std::shared_ptr.
|
||||
If that still isn't good enough for you and you <i>really</i> need to use a normal C style pointer
|
||||
then isolate your pointers inside a class or function so that they are contained in a small area of the code.
|
||||
However, in practice the container classes in dlib and the STL are more than sufficient in nearly
|
||||
|
@ -831,11 +831,8 @@
|
||||
<term file="dlib/svm/sparse_vector_abstract.h.html" name="has_unsigned_keys" include="dlib/sparse_vector.h"/>
|
||||
|
||||
<term file="containers.html" name="remover" include="dlib/interfaces/remover.h"/>
|
||||
<term file="containers.html" name="scoped_ptr" include="dlib/smart_pointers.h"/>
|
||||
<term file="containers.html" name="set" include="dlib/set.h"/>
|
||||
<term file="containers.html" name="shared_ptr" include="dlib/smart_pointers.h"/>
|
||||
<term file="containers.html" name="stack" include="dlib/stack.h"/>
|
||||
<term file="containers.html" name="weak_ptr" include="dlib/smart_pointers.h"/>
|
||||
<term file="containers.html" name="any" include="dlib/any.h"/>
|
||||
<term file="containers.html" name="any_function" include="dlib/any.h"/>
|
||||
<term file="containers.html" name="any_trainer" include="dlib/any.h"/>
|
||||
@ -1356,7 +1353,6 @@
|
||||
<term file="containers.html" name="reference_counter" include="dlib/reference_counter.h"/>
|
||||
|
||||
<term file="containers.html" name="sequence" include="dlib/sequence.h"/>
|
||||
<term file="containers.html" name="shared_ptr_thread_safe" include="dlib/smart_pointers_thread_safe.h"/>
|
||||
<term file="containers.html" name="sliding_buffer" include="dlib/sliding_buffer.h"/>
|
||||
<term file="containers.html" name="circular_buffer" include="dlib/sliding_buffer.h"/>
|
||||
<term file="containers.html" name="static_map" include="dlib/static_map.h"/>
|
||||
|
Loading…
Reference in New Issue
Block a user