8a165db0c0
2008-02-10 Benjamin Kosnik <bkoz@redhat.com> Convert documentation to DocBook. * doc/Makefile.am (doc-doxygen-html): Changed to doc-html-doxygen. (doc-doxygen-man): Changed to doc-man-doxygen. (doc-performance): Changed to doc-html-performance. (doc-xml-doxygen): New. (doc-xml-single): New. (doc-xml-validate): New. (doc-html): New. (doc-html-single): New. (doc-fo): New. (doc-pdf): New. (doc-pdf-fop-xml): New. (doc-pdf-fop-fo): New. (doc-pdf-xmlto): New. (doc-pdf-xmlroff): New. (doc-pdf-prince): New. * doc/xml: New directory. * doc/xml/authors.xml: New. * doc/xml/images: New directory. * doc/xml/images/confdeps.png: Add. * doc/xml/images/confdeps.dot: Add. * doc/xml/faq.xml: New. * doc/xml/api.xml: New. * doc/xml/gnu: New directory. * doc/xml/gnu/gpl-3.0.xml: New. * doc/xml/gnu/fdl-1.2.xml: New. * doc/xml/gnu/gpl-2.0.xml: New. * doc/xml/manual: New directory. * doc/xml/manual/mt_allocator.xml: New. * doc/xml/manual/allocator.xml: New. * doc/xml/manual/ctype.xml: New. * doc/xml/manual/numerics.xml: New. * doc/xml/manual/codecvt.xml: New. * doc/xml/manual/concurrency.xml: New. * doc/xml/manual/backwards_compatibility.xml: New. * doc/xml/manual/intro.xml: New. * doc/xml/manual/shared_ptr.xml: New. * doc/xml/manual/abi.xml: New. * doc/xml/manual/status_cxxtr1.xml: New. * doc/xml/manual/auto_ptr.xml: New. * doc/xml/manual/build.xml: New. * doc/xml/manual/internals.xml: New. * doc/xml/manual/parallel_mode.xml: New. * doc/xml/manual/status_cxx1998.xml: New. * doc/xml/manual/containers.xml: New. * doc/xml/manual/io.xml: New. * doc/xml/manual/appendix_porting.xml: New. * doc/xml/manual/utilities.xml: New. * doc/xml/manual/bitmap_allocator.xml: New. * doc/xml/manual/support.xml: New. * doc/xml/manual/configure.xml: New. * doc/xml/manual/build_hacking.xml: New. * doc/xml/manual/evolution.xml: New. * doc/xml/manual/using.xml: New. * doc/xml/manual/debug.xml: New. * doc/xml/manual/localization.xml: New. * doc/xml/manual/strings.xml: New. * doc/xml/manual/debug_mode.xml: New. * doc/xml/manual/locale.xml: New. * doc/xml/manual/extensions.xml: New. * doc/xml/manual/appendix_contributing.xml: New. * doc/xml/manual/messages.xml: New. * doc/xml/manual/diagnostics.xml: New. * doc/xml/manual/appendix_free.xml: New. * doc/xml/manual/algorithms.xml: New. * doc/xml/manual/iterators.xml: New. * doc/xml/manual/spine.xml: New. * doc/xml/manual/test.xml: New. * doc/xml/manual/status_cxx200x.xml: New. * doc/xml/spine.xml: New. * doc/xml/book.txml: New. Template file. * doc/xml/chapter.txml: Same. * doc/xml/class.txml: Same. * doc/doxygen/guide.html: Removed, integrated into other docs. * doc/doxygen/user.cfg.in: Clean up XML generation. * doc/doxygen/run_doxygen: Move to.. * scripts/run_doxygen: ...here. * configure: Regenerate. * Makefile.in: Regenerate. * src/Makefile.in: Regenerate. * doc/Makefile.in: Regenerate. * po/Makefile.in: Regenerate. * libmath/Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * libsupc++/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. * aclocal.m4: Regenerate. From-SVN: r132226
126 lines
4.3 KiB
XML
126 lines
4.3 KiB
XML
<?xml version='1.0'?>
|
|
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
|
|
[ ]>
|
|
|
|
<part id="manual.util" xreflabel="Utilities">
|
|
<?dbhtml filename="utilities.html"?>
|
|
|
|
<partinfo>
|
|
<keywordset>
|
|
<keyword>
|
|
ISO C++
|
|
</keyword>
|
|
<keyword>
|
|
library
|
|
</keyword>
|
|
</keywordset>
|
|
</partinfo>
|
|
|
|
<title>Utilities</title>
|
|
|
|
<!-- Chapter 01 : Functors -->
|
|
<chapter id="manual.util.functors" xreflabel="Functors">
|
|
<title>Functors</title>
|
|
<para>If you don't know what functors are, you're not alone. Many people
|
|
get slightly the wrong idea. In the interest of not reinventing
|
|
the wheel, we will refer you to the introduction to the functor
|
|
concept written by SGI as part of their STL, in
|
|
<ulink url="http://www.sgi.com/tech/stl/functors.html">their
|
|
http://www.sgi.com/tech/stl/functors.html</ulink>.
|
|
</para>
|
|
</chapter>
|
|
|
|
<!-- Chapter 02 : Pairs -->
|
|
<chapter id="manual.util.pairs" xreflabel="Pairs">
|
|
<title>Pairs</title>
|
|
<para>The <code>pair<T1,T2></code> is a simple and handy way to
|
|
carry around a pair of objects. One is of type T1, and another of
|
|
type T2; they may be the same type, but you don't get anything
|
|
extra if they are. The two members can be accessed directly, as
|
|
<code>.first</code> and <code>.second</code>.
|
|
</para>
|
|
<para>Construction is simple. The default ctor initializes each member
|
|
with its respective default ctor. The other simple ctor,
|
|
</para>
|
|
<programlisting>
|
|
pair (const T1& x, const T2& y);
|
|
</programlisting>
|
|
<para>does what you think it does, <code>first</code> getting <code>x</code>
|
|
and <code>second</code> getting <code>y</code>.
|
|
</para>
|
|
<para>There is a copy constructor, but it requires that your compiler
|
|
handle member function templates:
|
|
</para>
|
|
<programlisting>
|
|
template <class U, class V> pair (const pair<U,V>& p);
|
|
</programlisting>
|
|
<para>The compiler will convert as necessary from U to T1 and from
|
|
V to T2 in order to perform the respective initializations.
|
|
</para>
|
|
<para>The comparison operators are done for you. Equality
|
|
of two <code>pair<T1,T2></code>s is defined as both <code>first</code>
|
|
members comparing equal and both <code>second</code> members comparing
|
|
equal; this simply delegates responsibility to the respective
|
|
<code>operator==</code> functions (for types like MyClass) or builtin
|
|
comparisons (for types like int, char, etc).
|
|
</para>
|
|
<para>
|
|
The less-than operator is a bit odd the first time you see it. It
|
|
is defined as evaluating to:
|
|
</para>
|
|
<programlisting>
|
|
x.first < y.first ||
|
|
( !(y.first < x.first) && x.second < y.second )
|
|
</programlisting>
|
|
<para>The other operators are not defined using the <code>rel_ops</code>
|
|
functions above, but their semantics are the same.
|
|
</para>
|
|
<para>Finally, there is a template function called <function>make_pair</function>
|
|
that takes two references-to-const objects and returns an
|
|
instance of a pair instantiated on their respective types:
|
|
</para>
|
|
<programlisting>
|
|
pair<int,MyClass> p = make_pair(4,myobject);
|
|
</programlisting>
|
|
|
|
</chapter>
|
|
|
|
<!-- Chapter 03 : Memory -->
|
|
<chapter id="manual.util.memory" xreflabel="Memory">
|
|
|
|
<title>Memory</title>
|
|
<para>
|
|
Memory contains three general areas. First, function and operator
|
|
calls via <function>new</function> and <function>delete</function>
|
|
operator or member function calls. Second, allocation via
|
|
<classname>allocator</classname>. And finally, smart pointer and
|
|
intelligent pointer abstractions.
|
|
</para>
|
|
|
|
<!-- Section 01 : allocator -->
|
|
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
|
parse="xml" href="allocator.xml">
|
|
</xi:include>
|
|
|
|
<!-- Section 02 : auto_ptr -->
|
|
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
|
parse="xml" href="auto_ptr.xml">
|
|
</xi:include>
|
|
|
|
<!-- Section 03 : shared_ptr -->
|
|
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
|
parse="xml" href="shared_ptr.xml">
|
|
</xi:include>
|
|
|
|
</chapter>
|
|
|
|
<!-- Chapter 04 : Traits -->
|
|
<chapter id="manual.util.traits" xreflabel="Traits">
|
|
<title>Traits</title>
|
|
<para>
|
|
</para>
|
|
</chapter>
|
|
|
|
</part>
|