mirror of
https://github.com/boostorg/functional.git
synced 2025-08-01 21:44:28 +02:00
Fix annoying markup problems.
[SVN r71065]
This commit is contained in:
@@ -23,15 +23,17 @@
|
|||||||
[def __boost_function__ [@http://www.boost.org/doc/html/function.html Boost.Function]]
|
[def __boost_function__ [@http://www.boost.org/doc/html/function.html Boost.Function]]
|
||||||
[def __boost__function__ [@http://www.boost.org/doc/html/function.html `boost::function`]]
|
[def __boost__function__ [@http://www.boost.org/doc/html/function.html `boost::function`]]
|
||||||
|
|
||||||
|
[def __smart_pointer__ [@http://www.boost.org/libs/smart_ptr/index.html Smart Pointer]]
|
||||||
[def __smart_pointers__ [@http://www.boost.org/libs/smart_ptr/index.html Smart Pointers]]
|
[def __smart_pointers__ [@http://www.boost.org/libs/smart_ptr/index.html Smart Pointers]]
|
||||||
[def __boost__shared_ptr__ [@http://www.boost.org/libs/smart_ptr/shared_ptr.htm `boost::shared_ptr`]]
|
[def __boost__shared_ptr__ [@http://www.boost.org/libs/smart_ptr/shared_ptr.htm `boost::shared_ptr`]]
|
||||||
|
|
||||||
[def __std__map__ [@http://www.sgi.com/tech/stl/map.html `std::map`]]
|
[def __std__map__ [@http://www.sgi.com/tech/stl/map.html `std::map`]]
|
||||||
[def __std__string__ [@http://www.sgi.com/tech/stl/string.html `std::string`]]
|
[def __std__string__ [@http://www.sgi.com/tech/stl/string.html `std::string`]]
|
||||||
|
[def __allocator__ [@http://www.sgi.com/tech/stl/concepts/allocator.html Allocator]]
|
||||||
[def __std_allocator__ [@http://www.sgi.com/tech/stl/concepts/allocator.html Allocator]]
|
[def __std_allocator__ [@http://www.sgi.com/tech/stl/concepts/allocator.html Allocator]]
|
||||||
[def __std_allocators__ [@http://www.sgi.com/tech/stl/concepts/allocator.html Allocators]]
|
[def __std_allocators__ [@http://www.sgi.com/tech/stl/concepts/allocator.html Allocators]]
|
||||||
|
|
||||||
[def __boost__ptr_map__ [@http://www.boost.org/libs/ptr_container/doc/ptr_map.html `__boost__ptr_map__`]]
|
[def __boost__ptr_map__ [@http://www.boost.org/libs/ptr_container/doc/ptr_map.html `boost::ptr_map`]]
|
||||||
|
|
||||||
[def __boost__factory__ `boost::factory`]
|
[def __boost__factory__ `boost::factory`]
|
||||||
[def __boost__value_factory__ `boost::value_factory`]
|
[def __boost__value_factory__ `boost::value_factory`]
|
||||||
@@ -117,16 +119,16 @@ lots of boilerplate code. In other words there is too much code to express
|
|||||||
a rather simple intention. We could use templates to get rid of some of it
|
a rather simple intention. We could use templates to get rid of some of it
|
||||||
but the approach remains inflexible:
|
but the approach remains inflexible:
|
||||||
|
|
||||||
o We may want a factory that takes some arguments that are forwarded to
|
* We may want a factory that takes some arguments that are forwarded to
|
||||||
the constructor,
|
the constructor,
|
||||||
o we will probably want to use smart pointers,
|
* we will probably want to use smart pointers,
|
||||||
o we may want several member functions to create different kinds of
|
* we may want several member functions to create different kinds of
|
||||||
objects,
|
objects,
|
||||||
o we might not necessarily need a polymorphic base class for the objects,
|
* we might not necessarily need a polymorphic base class for the objects,
|
||||||
o as we will see, we do not need a factory base class at all,
|
* as we will see, we do not need a factory base class at all,
|
||||||
o we might want to just call the constructor - without `new` to create
|
* we might want to just call the constructor - without `new` to create
|
||||||
an object on the stack, and
|
an object on the stack, and
|
||||||
o finally we might want to use customized memory management.
|
* finally we might want to use customized memory management.
|
||||||
|
|
||||||
Experience has shown that using function objects and generic Boost components
|
Experience has shown that using function objects and generic Boost components
|
||||||
for their composition, Design Patterns that describe callback mechasisms
|
for their composition, Design Patterns that describe callback mechasisms
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
</h3></div></div>
|
</h3></div></div>
|
||||||
<div><p class="copyright">Copyright © 2007, 2008 Tobias Schwinger</p></div>
|
<div><p class="copyright">Copyright © 2007, 2008 Tobias Schwinger</p></div>
|
||||||
<div><div class="legalnotice">
|
<div><div class="legalnotice">
|
||||||
<a name="id2865350"></a><p>
|
<a name="id3353252"></a><p>
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||||
</p>
|
</p>
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
</span>
|
</span>
|
||||||
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
|
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
|
||||||
<span class="special">{</span>
|
<span class="special">{</span>
|
||||||
<a href="http://www.boost.org/libs/ptr_container/doc/ptr_map.html" target="_top"><code class="computeroutput"><span class="identifier">__boost__ptr_map__</span></code></a><span class="special"><</span><a href="http://www.sgi.com/tech/stl/string.html" target="_top"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></code></a><span class="special">,</span><span class="identifier">a_factory</span><span class="special">></span> <span class="identifier">factories</span><span class="special">;</span>
|
<a href="http://www.boost.org/libs/ptr_container/doc/ptr_map.html" target="_top"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ptr_map</span></code></a><span class="special"><</span><a href="http://www.sgi.com/tech/stl/string.html" target="_top"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span></code></a><span class="special">,</span><span class="identifier">a_factory</span><span class="special">></span> <span class="identifier">factories</span><span class="special">;</span>
|
||||||
|
|
||||||
<span class="comment">// [...]
|
<span class="comment">// [...]
|
||||||
</span>
|
</span>
|
||||||
@@ -125,17 +125,31 @@
|
|||||||
a rather simple intention. We could use templates to get rid of some of it
|
a rather simple intention. We could use templates to get rid of some of it
|
||||||
but the approach remains inflexible:
|
but the approach remains inflexible:
|
||||||
</p>
|
</p>
|
||||||
<pre class="programlisting"><span class="identifier">o</span> <span class="identifier">We</span> <span class="identifier">may</span> <span class="identifier">want</span> <span class="identifier">a</span> <span class="identifier">factory</span> <span class="identifier">that</span> <span class="identifier">takes</span> <span class="identifier">some</span> <span class="identifier">arguments</span> <span class="identifier">that</span> <span class="identifier">are</span> <span class="identifier">forwarded</span> <span class="identifier">to</span>
|
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||||
<span class="identifier">the</span> <span class="identifier">constructor</span><span class="special">,</span>
|
<li class="listitem">
|
||||||
<span class="identifier">o</span> <span class="identifier">we</span> <span class="identifier">will</span> <span class="identifier">probably</span> <span class="identifier">want</span> <span class="identifier">to</span> <span class="identifier">use</span> <span class="identifier">smart</span> <span class="identifier">pointers</span><span class="special">,</span>
|
We may want a factory that takes some arguments that are forwarded to the
|
||||||
<span class="identifier">o</span> <span class="identifier">we</span> <span class="identifier">may</span> <span class="identifier">want</span> <span class="identifier">several</span> <span class="identifier">member</span> <span class="identifier">functions</span> <span class="identifier">to</span> <span class="identifier">create</span> <span class="identifier">different</span> <span class="identifier">kinds</span> <span class="identifier">of</span>
|
constructor,
|
||||||
<span class="identifier">objects</span><span class="special">,</span>
|
</li>
|
||||||
<span class="identifier">o</span> <span class="identifier">we</span> <span class="identifier">might</span> <span class="keyword">not</span> <span class="identifier">necessarily</span> <span class="identifier">need</span> <span class="identifier">a</span> <span class="identifier">polymorphic</span> <span class="identifier">base</span> <span class="keyword">class</span> <span class="keyword">for</span> <span class="identifier">the</span> <span class="identifier">objects</span><span class="special">,</span>
|
<li class="listitem">
|
||||||
<span class="identifier">o</span> <span class="identifier">as</span> <span class="identifier">we</span> <span class="identifier">will</span> <span class="identifier">see</span><span class="special">,</span> <span class="identifier">we</span> <span class="keyword">do</span> <span class="keyword">not</span> <span class="identifier">need</span> <span class="identifier">a</span> <span class="identifier">factory</span> <span class="identifier">base</span> <span class="keyword">class</span> <span class="identifier">at</span> <span class="identifier">all</span><span class="special">,</span>
|
we will probably want to use smart pointers,
|
||||||
<span class="identifier">o</span> <span class="identifier">we</span> <span class="identifier">might</span> <span class="identifier">want</span> <span class="identifier">to</span> <span class="identifier">just</span> <span class="identifier">call</span> <span class="identifier">the</span> <span class="identifier">constructor</span> <span class="special">-</span> <span class="identifier">without</span> <span class="error">`</span><span class="keyword">new</span><span class="error">`</span> <span class="identifier">to</span> <span class="identifier">create</span>
|
</li>
|
||||||
<span class="identifier">an</span> <span class="identifier">object</span> <span class="identifier">on</span> <span class="identifier">the</span> <span class="identifier">stack</span><span class="special">,</span> <span class="keyword">and</span>
|
<li class="listitem">
|
||||||
<span class="identifier">o</span> <span class="identifier">finally</span> <span class="identifier">we</span> <span class="identifier">might</span> <span class="identifier">want</span> <span class="identifier">to</span> <span class="identifier">use</span> <span class="identifier">customized</span> <span class="identifier">memory</span> <span class="identifier">management</span><span class="special">.</span>
|
we may want several member functions to create different kinds of objects,
|
||||||
</pre>
|
</li>
|
||||||
|
<li class="listitem">
|
||||||
|
we might not necessarily need a polymorphic base class for the objects,
|
||||||
|
</li>
|
||||||
|
<li class="listitem">
|
||||||
|
as we will see, we do not need a factory base class at all,
|
||||||
|
</li>
|
||||||
|
<li class="listitem">
|
||||||
|
we might want to just call the constructor - without <code class="computeroutput"><span class="keyword">new</span></code>
|
||||||
|
to create an object on the stack, and
|
||||||
|
</li>
|
||||||
|
<li class="listitem">
|
||||||
|
finally we might want to use customized memory management.
|
||||||
|
</li>
|
||||||
|
</ul></div>
|
||||||
<p>
|
<p>
|
||||||
Experience has shown that using function objects and generic Boost components
|
Experience has shown that using function objects and generic Boost components
|
||||||
for their composition, Design Patterns that describe callback mechasisms (typically
|
for their composition, Design Patterns that describe callback mechasisms (typically
|
||||||
@@ -401,12 +415,13 @@
|
|||||||
yields the pointee type.
|
yields the pointee type.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
If an <span class="underline">_allocator_</span> is given, it is used
|
If an <a href="http://www.sgi.com/tech/stl/concepts/allocator.html" target="_top">Allocator</a>
|
||||||
for memory allocation and the placement form of the <code class="computeroutput"><span class="keyword">new</span></code>
|
is given, it is used for memory allocation and the placement form of the
|
||||||
operator is used to construct the object. A function object that calls the
|
<code class="computeroutput"><span class="keyword">new</span></code> operator is used to construct
|
||||||
destructor and deallocates the memory with a copy of the Allocator is used
|
the object. A function object that calls the destructor and deallocates the
|
||||||
for the second constructor argument of <code class="computeroutput"><span class="identifier">Pointer</span></code>
|
memory with a copy of the Allocator is used for the second constructor argument
|
||||||
(thus it must be a <span class="underline">_smart_pointer_</span>
|
of <code class="computeroutput"><span class="identifier">Pointer</span></code> (thus it must
|
||||||
|
be a <a href="http://www.boost.org/libs/smart_ptr/index.html" target="_top">Smart Pointer</a>
|
||||||
that provides a suitable constructor, such as <a href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm" target="_top"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span></code></a>).
|
that provides a suitable constructor, such as <a href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm" target="_top"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span></code></a>).
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
Reference in New Issue
Block a user