Commit 64a6f971 by Jonathan Wakely Committed by Phil Edwards

Makefile: Use more portable shell wildcard.

2002-09-05  Jonathan Wakely  <jw@kayari.org>

	* docs/html/Makefile:  Use more portable shell wildcard.
	* docs/html/makedoc.awk:  Nest elements correctly for XHTML conversion.
	* docs/html/configopts.html, docs/html/documentation.html,
	docs/html/explanations.html, docs/html/install.html,
	docs/html/17_intro/contribute.html, docs/html/17_intro/howto.html,
	docs/html/17_intro/license.html, docs/html/18_support/howto.html,
	docs/html/19_diagnostics/howto.html, docs/html/20_util/howto.html,
	docs/html/21_strings/howto.html, docs/html/22_locale/codecvt.html,
	docs/html/22_locale/ctype.html, docs/html/22_locale/howto.html,
	docs/html/22_locale/locale.html, docs/html/22_locale/messages.html,
	docs/html/23_containers/howto.html, docs/html/24_iterators/howto.html,
	docs/html/25_algorithms/howto.html, docs/html/26_numerics/howto.html,
	docs/html/27_io/howto.html, docs/html/ext/howto.html,
	docs/html/ext/sgiexts.html, docs/html/faq/index.html:  Convert
	to XHTML.
	* docs/html/faq/index.txt:  Regenerate.

From-SVN: r56845
parent 3578cf63
2002-09-05 Jonathan Wakely <jw@kayari.org>
* docs/html/Makefile: Use more portable shell wildcard.
* docs/html/makedoc.awk: Nest elements correctly for XHTML conversion.
* docs/html/configopts.html, docs/html/documentation.html,
docs/html/explanations.html, docs/html/install.html,
docs/html/17_intro/contribute.html, docs/html/17_intro/howto.html,
docs/html/17_intro/license.html, docs/html/18_support/howto.html,
docs/html/19_diagnostics/howto.html, docs/html/20_util/howto.html,
docs/html/21_strings/howto.html, docs/html/22_locale/codecvt.html,
docs/html/22_locale/ctype.html, docs/html/22_locale/howto.html,
docs/html/22_locale/locale.html, docs/html/22_locale/messages.html,
docs/html/23_containers/howto.html, docs/html/24_iterators/howto.html,
docs/html/25_algorithms/howto.html, docs/html/26_numerics/howto.html,
docs/html/27_io/howto.html, docs/html/ext/howto.html,
docs/html/ext/sgiexts.html, docs/html/faq/index.html: Convert
to XHTML.
* docs/html/faq/index.txt: Regenerate.
2002-09-05 Jakub Jelinek <jakub@redhat.com> 2002-09-05 Jakub Jelinek <jakub@redhat.com>
* config/locale/gnu/ctype_members.cc (ctype<wchar_t>::do_widen(char)): * config/locale/gnu/ctype_members.cc (ctype<wchar_t>::do_widen(char)):
......
<!--990301 slightly modified version of the GCC contribute.html file-->
<html> <html>
<head> <head>
<title>How to contribute</title> <title>How to contribute</title>
</head> </head>
<!--#include virtual="/include/header-subpages.html"--> <!--990301 slightly modified version of the GCC contribute.html file-->
<!-- #include virtual="/include/header-subpages.html"-->
<body>
<h2>How to contribute</h2> <h2>How to contribute</h2>
<p> <p>
The Standard C++ Library v3, or libstc++-2.90.x, follows an open development model. Active contributors are assigned maintainer-ship responsibility, and given write access to the CVS repository. First time submitors and all other potential contributors should follow this procedure: The Standard C++ Library v3, or libstc++-2.90.x, follows an open development model. Active contributors are assigned maintainer-ship responsibility, and given write access to the CVS repository. First time submitors and all other potential contributors should follow this procedure:
</p>
<p> <hr />
<hr>
<h4>ONE : read the documentation</h4> <h4>ONE : read the documentation</h4>
<p>
<p>
<ul> <ul>
<li> Get and read the relevant sections of the C++ language <li> Get and read the relevant sections of the C++ language
specification. Copies of the full ISO 14882 standard are available on specification. Copies of the full ISO 14882 standard are available on
...@@ -27,25 +26,30 @@ and their web-site is right ...@@ -27,25 +26,30 @@ and their web-site is right
<a href="http://www.ansi.org">here.</a> <a href="http://www.ansi.org">here.</a>
(And if you've already registered with them, clicking this link will take you to directly to the place where you can (And if you've already registered with them, clicking this link will take you to directly to the place where you can
<a href="http://webstore.ansi.org/ansidocstore/product.asp?sku=ISO%2FIEC+14882%2D1998">buy the standard on-line.)</a> <a href="http://webstore.ansi.org/ansidocstore/product.asp?sku=ISO%2FIEC+14882%2D1998">buy the standard on-line.)</a>
</li>
<li> The library working group bugs, and known defects, can be obtained at these web sites: <li> The library working group bugs, and known defects, can be obtained at these web sites:
<a href="http://www.dkuug.dk/jtc1/sc22/wg21/">http://www.dkuug.dk/jtc1/sc22/wg21 </a> <a href="http://www.dkuug.dk/jtc1/sc22/wg21/">http://www.dkuug.dk/jtc1/sc22/wg21 </a>
and <a href="http://www.comeaucomputing.com/iso/">http://www.comeaucomputing.com/iso/</a> and <a href="http://www.comeaucomputing.com/iso/">http://www.comeaucomputing.com/iso/</a>
</li>
<li> The newsgroup dedicated to standardization issues is comp.std.c++: this FAQ for this group is quite useful and can be found <a href="http://reality.sgi.com/austern_mti/std-c++/faq.html"> here </a>. <li> The newsgroup dedicated to standardization issues is comp.std.c++: this FAQ for this group is quite useful and can be found <a href="http://reality.sgi.com/austern_mti/std-c++/faq.html"> here </a>.
</li>
<li> Peruse the <a href="http://www.gnu.ai.mit.edu/prep/standards_toc.html">GNU Coding Standards</a>, and chuckle when you hit the part about "Using Languages Other Than C." <li> Peruse the <a href="http://www.gnu.ai.mit.edu/prep/standards_toc.html">GNU Coding Standards</a>, and chuckle when you hit the part about "Using Languages Other Than C."
</li>
<li> Be familiar with the extensions that preceded these general GNU rules. These style issues for libstdc++ can be found in the file C++STYLE, located in the root level of the distribution, or <a href="C++STYLE"> here. </a> <li> Be familiar with the extensions that preceded these general GNU rules. These style issues for libstdc++ can be found in the file C++STYLE, located in the root level of the distribution, or <a href="C++STYLE"> here. </a>
</li>
<li> And last but certainly not least, read the library-specific information found <a href="../documentation.html"> here.</a> <li> And last but certainly not least, read the library-specific information found <a href="../documentation.html"> here.</a>
</li>
</ul> </ul>
<p> <hr />
<hr>
<h4>TWO : copyright assignment</h4> <h4>TWO : copyright assignment</h4>
<p> <p>
Small changes can be accepted without a copyright assignment form on Small changes can be accepted without a copyright assignment form on
...@@ -56,40 +60,43 @@ to fill out appropriate disclaimer forms as well. Here is the <a href="libstdc++ ...@@ -56,40 +60,43 @@ to fill out appropriate disclaimer forms as well. Here is the <a href="libstdc++
Please contact <a href="mailto:benjamin@cygnus.com">Benjamin Please contact <a href="mailto:benjamin@cygnus.com">Benjamin
Kosnik</a> if you are confused about the assignment or have general Kosnik</a> if you are confused about the assignment or have general
licensing questions. licensing questions.
</p>
<p> <hr />
<hr>
<h4>THREE : submitting patches</h4> <h4>THREE : submitting patches</h4>
<p>
<p>
Every patch must have several pieces of information before it can be Every patch must have several pieces of information before it can be
properly evaluated. Ideally (and to ensure the fastest possible properly evaluated. Ideally (and to ensure the fastest possible
response from the maintainers) it would have all of these pieces: response from the maintainers) it would have all of these pieces:
<p> </p>
<ul> <ul>
<li> A description of the bug and how your patch fixes this bug. For <li> A description of the bug and how your patch fixes this bug. For
new features a description of the feature and your implementation. new features a description of the feature and your implementation. </li>
<li> A ChangeLog entry as plaintext; see the various ChangeLog files <li> A ChangeLog entry as plaintext; see the various ChangeLog files
for format and content. If using you are using emacs as your editor, for format and content. If using you are using emacs as your editor,
simply position the insertion point at the beginning of your change simply position the insertion point at the beginning of your change
and hit CX-4a to bring up the appropriate ChangeLog and hit CX-4a to bring up the appropriate ChangeLog
entry. See--magic! Similar functionality also exists for vi. entry. See--magic! Similar functionality also exists for vi. </li>
<li> A testsuite submission or sample program that will easily and <li> A testsuite submission or sample program that will easily and
simply show the existing error or test new functionality. simply show the existing error or test new functionality. </li>
<li> The patch itself. If you are accessing the CVS repository at <li> The patch itself. If you are accessing the CVS repository at
Cygnus, use "cvs update; cvs diff -c3p NEW"; else, use "diff -c3p OLD Cygnus, use "cvs update; cvs diff -c3p NEW"; else, use "diff -c3p OLD
NEW" ... If your version of diff does not support these options, then NEW" ... If your version of diff does not support these options, then
get the latest version of GNU diff. get the latest version of GNU diff. </li>
<li> When you have all these pieces, bundle them up in a mail message <li> When you have all these pieces, bundle them up in a mail message
and send it to libstdc++@gcc.gnu.org. All patches and related and send it to libstdc++@gcc.gnu.org. All patches and related
discussion should be sent to the libstdc++ mailinglist. discussion should be sent to the libstdc++ mailinglist. </li>
</ul> </ul>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)"> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
<meta name="KEYWORDS" content="HOWTO, libstdc++, gcc, g++, libg++, STL"> <meta name="KEYWORDS" content="HOWTO, libstdc++, gcc, g++, libg++, STL" />
<meta name="DESCRIPTION" content="HOWTO for libstdc++ chapter 17."> <meta name="DESCRIPTION" content="HOWTO for libstdc++ chapter 17." />
<meta name="GENERATOR" content="vi and eight fingers"> <meta name="GENERATOR" content="vi and eight fingers" />
<title>libstdc++-v3 HOWTO: Chapter 17</title> <title>libstdc++-v3 HOWTO: Chapter 17</title>
<link rel="StyleSheet" href="../lib3styles.css"> <link rel="StyleSheet" href="../lib3styles.css" />
</head> </head>
<body> <body>
...@@ -21,18 +20,18 @@ ...@@ -21,18 +20,18 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<h1>Contents</h1> <h1>Contents</h1>
<ul> <ul>
<li><a href="#2">The Standard C++ header files</a> <li><a href="#2">The Standard C++ header files</a></li>
<li><a href="#3">The Standard C++ library and multithreading</a> <li><a href="#3">The Standard C++ library and multithreading</a></li>
<li><a href="#4"><code>&lt;foo&gt;</code> vs <code>&lt;foo.h&gt;</code></a> <li><a href="#4"><code>&lt;foo&gt;</code> vs <code>&lt;foo.h&gt;</code></a></li>
<li><a href="porting-howto.html">Porting HOWTO</a> <li><a href="porting-howto.html">Porting HOWTO</a></li>
<li><a href="#5">Behavior specific to libstdc++-v3</a> <li><a href="#5">Behavior specific to libstdc++-v3</a></li>
<li><a href="#6">Preprocessor macros controlling the library</a> <li><a href="#6">Preprocessor macros controlling the library</a></li>
</ul> </ul>
<hr> <hr />
<!-- ####################################################### --> <!-- ####################################################### -->
...@@ -51,7 +50,7 @@ ...@@ -51,7 +50,7 @@
all compile and run. all compile and run.
</p> </p>
<hr> <hr />
<h2><a name="3">The Standard C++ library and multithreading</a></h2> <h2><a name="3">The Standard C++ library and multithreading</a></h2>
<p>This section discusses issues surrounding the proper compilation <p>This section discusses issues surrounding the proper compilation
of multithreaded applications which use the Standard C++ of multithreaded applications which use the Standard C++
...@@ -129,16 +128,17 @@ ...@@ -129,16 +128,17 @@
relevant message in the thread; from there you can use relevant message in the thread; from there you can use
&quot;Thread Next&quot; to move down the thread. This farm is in &quot;Thread Next&quot; to move down the thread. This farm is in
latest-to-oldest order. latest-to-oldest order.
</p>
<ul> <ul>
<li>Our threading expert Loren gives a breakdown of <li>Our threading expert Loren gives a breakdown of
<a href="http://gcc.gnu.org/ml/libstdc++/2001-10/msg00024.html">the <a href="http://gcc.gnu.org/ml/libstdc++/2001-10/msg00024.html">the
six situations involving threads</a> for the 3.0 release series. six situations involving threads</a> for the 3.0 release series.</li>
<li><a href="http://gcc.gnu.org/ml/libstdc++/2001-05/msg00384.html"> <li><a href="http://gcc.gnu.org/ml/libstdc++/2001-05/msg00384.html">
This message</a> inspired a recent updating of issues with threading This message</a> inspired a recent updating of issues with threading
and the SGI STL library. It also contains some example and the SGI STL library. It also contains some example
POSIX-multithreaded STL code. POSIX-multithreaded STL code.</li>
</ul> </ul>
(A large selection of links to older messages has been removed; many <p> (A large selection of links to older messages has been removed; many
of the messages from 1999 were lost in a disk crash, and the few of the messages from 1999 were lost in a disk crash, and the few
people with access to the backup tapes have been too swamped with work people with access to the backup tapes have been too swamped with work
to restore them. Many of the points have been superseded anyhow.) to restore them. Many of the points have been superseded anyhow.)
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="4"><code>&lt;foo&gt;</code> vs <code>&lt;foo.h&gt;</code></a></h2> <h2><a name="4"><code>&lt;foo&gt;</code> vs <code>&lt;foo.h&gt;</code></a></h2>
<p>The new-style headers are fully supported in libstdc++-v3. The compiler <p>The new-style headers are fully supported in libstdc++-v3. The compiler
itself fully supports namespaces, including <code>std::</code>. itself fully supports namespaces, including <code>std::</code>.
...@@ -164,16 +164,18 @@ ...@@ -164,16 +164,18 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="5">Behavior specific to libstdc++-v3</a></h2> <h2><a name="5">Behavior specific to libstdc++-v3</a></h2>
<p>The ISO standard defines the following phrase: <p>The ISO standard defines the following phrase:
</p>
<blockquote><dl> <blockquote><dl>
<dt><code>[1.3.5] implementation-defined behavior</code> <dt><code>[1.3.5] implementation-defined behavior</code></dt>
<dd>behavior, for a well-formed program construct and correct data, that <dd>behavior, for a well-formed program construct and correct data, that
depends on the implementation <strong>and that each implementation depends on the implementation <strong>and that each implementation
shall document</strong>. shall document</strong>.
</dd>
</dl></blockquote> </dl></blockquote>
We do so here, for the C++ library only. Behavior of the compiler, <p>We do so here, for the C++ library only. Behavior of the compiler,
linker, runtime loader, and other elements of &quot;the linker, runtime loader, and other elements of &quot;the
implementation&quot; are documented elsewhere. Everything listed in implementation&quot; are documented elsewhere. Everything listed in
Annex B, Implemenation Qualities, are also part of the compiler, not Annex B, Implemenation Qualities, are also part of the compiler, not
...@@ -196,10 +198,10 @@ ...@@ -196,10 +198,10 @@
sections, libstdc++-v3 has zero control over what the cleanup code hands sections, libstdc++-v3 has zero control over what the cleanup code hands
back to the runtime loader. Talk to the compiler people. :-) back to the runtime loader. Talk to the compiler people. :-)
</p> </p>
<p><strong>[18.4.2.1]/5</strong> (bad_alloc),<br> <p><strong>[18.4.2.1]/5</strong> (bad_alloc),<br />
<strong>[18.5.2]/5</strong> (bad_cast),<br> <strong>[18.5.2]/5</strong> (bad_cast),<br />
<strong>[18.5.3]/5</strong> (bad_typeid),<br> <strong>[18.5.3]/5</strong> (bad_typeid),<br />
<strong>[18.6.1]/8</strong> (exception),<br> <strong>[18.6.1]/8</strong> (exception),<br />
<strong>[18.6.2.1]/5</strong> (bad_exception): The <code>what()</code> <strong>[18.6.2.1]/5</strong> (bad_exception): The <code>what()</code>
member function of class <code>std::exception</code>, and these other member function of class <code>std::exception</code>, and these other
classes publicly derived from it, simply returns the name of the classes publicly derived from it, simply returns the name of the
...@@ -225,10 +227,10 @@ ...@@ -225,10 +227,10 @@
have any allocators which compare non-equal, so we can't describe how have any allocators which compare non-equal, so we can't describe how
they behave. they behave.
</p> </p>
<p><strong>[21.1.3.1]/3,4</strong>,<br> <p><strong>[21.1.3.1]/3,4</strong>,<br />
<strong>[21.1.3.2]/2</strong>,<br> <strong>[21.1.3.2]/2</strong>,<br />
<strong>[23.*]'s foo::iterator</strong>,<br> <strong>[23.*]'s foo::iterator</strong>,<br />
<strong>[27.*]'s foo::*_type</strong>,<br> <strong>[27.*]'s foo::*_type</strong>,<br />
<strong>others...</strong> <strong>others...</strong>
Nope, these types are called implementation-defined because you Nope, these types are called implementation-defined because you
shouldn't be taking advantage of their underlying types. Listing them shouldn't be taking advantage of their underlying types. Listing them
...@@ -257,7 +259,7 @@ ...@@ -257,7 +259,7 @@
than the minimum required. I don't think we're currently taking than the minimum required. I don't think we're currently taking
advantage of this yet. advantage of this yet.
</p> </p>
<p><strong>[27.7.1.3]/16</strong>,<br> <p><strong>[27.7.1.3]/16</strong>,<br />
<strong>[27.8.1.4]/10</strong> <strong>[27.8.1.4]/10</strong>
The effects of <code>pubsetbuf/setbuf</code> are described The effects of <code>pubsetbuf/setbuf</code> are described
<a href="../27_io/howto.html#2">in this chapter</a>. <a href="../27_io/howto.html#2">in this chapter</a>.
...@@ -269,7 +271,7 @@ ...@@ -269,7 +271,7 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="6">Preprocessor macros controlling the library</a></h2> <h2><a name="6">Preprocessor macros controlling the library</a></h2>
<p>Some of the semantics of the libstdc++-v3 implementation are <p>Some of the semantics of the libstdc++-v3 implementation are
controlled by preprocessor macros, both during build/installation and controlled by preprocessor macros, both during build/installation and
...@@ -297,6 +299,7 @@ ...@@ -297,6 +299,7 @@
The default state of the symbol is listed. &quot;Configurable&quot; The default state of the symbol is listed. &quot;Configurable&quot;
(or &quot;Not configurable&quot;) means that the symbol is initially (or &quot;Not configurable&quot;) means that the symbol is initially
chosen (or not) based on --enable/--disable options at configure time. chosen (or not) based on --enable/--disable options at configure time.
</p>
<dl> <dl>
<dt><code>_GLIBCPP_DEPRECATED</code></dt> <dt><code>_GLIBCPP_DEPRECATED</code></dt>
<dd>Undefined by default. Not configurable. Turning this on enables <dd>Undefined by default. Not configurable. Turning this on enables
...@@ -329,7 +332,6 @@ ...@@ -329,7 +332,6 @@
</dd> </dd>
--> -->
</dl> </dl>
</p>
<p>Return <a href="#top">to top of page</a> or <p>Return <a href="#top">to top of page</a> or
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
...@@ -338,7 +340,7 @@ ...@@ -338,7 +340,7 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<p class="fineprint"><em> <p class="fineprint"><em>
See <a href="license.html">license.html</a> for copying conditions. See <a href="license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to Comments and suggestions are welcome, and may be sent to
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)"> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
<meta name="KEYWORDS" content="libstdc++, license, licence"> <meta name="KEYWORDS" content="libstdc++, license, licence" />
<meta name="DESCRIPTION" content="Copying restrictions for libstdc++."> <meta name="DESCRIPTION" content="Copying restrictions for libstdc++." />
<meta name="GENERATOR" content="vi and eight fingers"> <meta name="GENERATOR" content="vi and eight fingers" />
<title>libstdc++-v3 copying</title> <title>libstdc++-v3 copying</title>
<link rel="StyleSheet" href="../lib3styles.css"> <link rel="StyleSheet" href="../lib3styles.css" />
</head> </head>
<body> <body>
...@@ -21,7 +20,7 @@ ...@@ -21,7 +20,7 @@
writing this page is a programmer, not a lawyer. writing this page is a programmer, not a lawyer.
</p> </p>
<hr> <hr />
<h2>The Code: Runtime GPL</h2> <h2>The Code: Runtime GPL</h2>
...@@ -29,7 +28,8 @@ ...@@ -29,7 +28,8 @@
<a href="COPYING">GNU General Public License</a>, with the so-called <a href="COPYING">GNU General Public License</a>, with the so-called
&quot;runtime exception,&quot; as follows (or see any header or &quot;runtime exception,&quot; as follows (or see any header or
implementation file): implementation file):
<pre> </p>
<pre>
As a special exception, you may use this file as part of a free software As a special exception, you may use this file as part of a free software
library without restriction. Specifically, if other files instantiate library without restriction. Specifically, if other files instantiate
templates or use macros or inline functions from this file, or you compile templates or use macros or inline functions from this file, or you compile
...@@ -38,8 +38,7 @@ ...@@ -38,8 +38,7 @@
the GNU General Public License. This exception does not however the GNU General Public License. This exception does not however
invalidate any other reasons why the executable file might be covered by invalidate any other reasons why the executable file might be covered by
the GNU General Public License. the GNU General Public License.
</pre> </pre>
</p>
<p>Hopefully that text is self-explanatory. If it isn't, you need to speak <p>Hopefully that text is self-explanatory. If it isn't, you need to speak
to your lawyer, or the Free Software Foundation. to your lawyer, or the Free Software Foundation.
...@@ -50,14 +49,14 @@ ...@@ -50,14 +49,14 @@
http://gcc.gnu.org/ml/libstdc++/2000-q2/subjects.html#00050 http://gcc.gnu.org/ml/libstdc++/2000-q2/subjects.html#00050
--> -->
<p><strong>Q: So any program which uses libstdc++ falls under the GPL?</strong> <p><strong>Q: So any program which uses libstdc++ falls under the GPL?</strong>
<br>A: <strong>No.</strong> The special exception permits use of the <br />A: <strong>No.</strong> The special exception permits use of the
library in proprietary applications. library in proprietary applications.
</p> </p>
<p><strong>Q: How is that different from the GNU {Lesser,Library} <p><strong>Q: How is that different from the GNU {Lesser,Library}
GPL?</strong> GPL?</strong>
<!-- Quoting Jason Merrill from the thread above: --> <!-- Quoting Jason Merrill from the thread above: -->
<br>A: The LGPL requires that users be able to replace the LGPL code with a <br />A: The LGPL requires that users be able to replace the LGPL code with a
modified version; this is trivial if the library in question is a C modified version; this is trivial if the library in question is a C
shared library. But there's no way to make that work with C++, where shared library. But there's no way to make that work with C++, where
much of the library consists of inline functions and templates, which much of the library consists of inline functions and templates, which
...@@ -68,11 +67,11 @@ ...@@ -68,11 +67,11 @@
<p><strong>Q: I see. So, what restrictions <em>are</em> there on <p><strong>Q: I see. So, what restrictions <em>are</em> there on
programs that use the library?</strong> programs that use the library?</strong>
<br>A: None. We encourage such programs to be released as open source, <br />A: None. We encourage such programs to be released as open source,
but we won't punish you or sue you if you choose otherwise. but we won't punish you or sue you if you choose otherwise.
</p> </p>
<hr> <hr />
<h2>The Docs: FDL</h2> <h2>The Docs: FDL</h2>
...@@ -92,7 +91,7 @@ ...@@ -92,7 +91,7 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<p class="fineprint"><em> <p class="fineprint"><em>
Comments and suggestions about this page are welcome, and may be sent to Comments and suggestions about this page are welcome, and may be sent to
<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>. <a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)"> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
<meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL"> <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL" />
<meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 18."> <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 18." />
<meta name="GENERATOR" content="vi and eight fingers"> <meta name="GENERATOR" content="vi and eight fingers" />
<title>libstdc++-v3 HOWTO: Chapter 18</title> <title>libstdc++-v3 HOWTO: Chapter 18</title>
<link rel="StyleSheet" href="../lib3styles.css"> <link rel="StyleSheet" href="../lib3styles.css" />
</head> </head>
<body> <body>
...@@ -24,17 +23,17 @@ ...@@ -24,17 +23,17 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<h1>Contents</h1> <h1>Contents</h1>
<ul> <ul>
<li><a href="#1">Types</a> <li><a href="#1">Types</a></li>
<li><a href="#2">Implementation properties</a> <li><a href="#2">Implementation properties</a></li>
<li><a href="#3">Start and Termination</a> <li><a href="#3">Start and Termination</a></li>
<li><a href="#4">Dynamic memory management</a> <li><a href="#4">Dynamic memory management</a></li>
<li><a href="#5">RTTI, the ABI, and demangling</a> <li><a href="#5">RTTI, the ABI, and demangling</a></li>
</ul> </ul>
<hr> <hr />
<!-- ####################################################### --> <!-- ####################################################### -->
...@@ -55,11 +54,12 @@ ...@@ -55,11 +54,12 @@
always a pointer.) always a pointer.)
</p> </p>
<p>In his book <p>In his book
<a href="http://cseng.aw.com/bookdetail.qry?ISBN=0-201-92488-9&ptype=0"><em>Effective C++</em></a>, <a href="http://cseng.aw.com/bookdetail.qry?ISBN=0-201-92488-9&amp;ptype=0"><em>Effective C++</em></a>,
Scott Meyers points out that the best way to solve this problem is to Scott Meyers points out that the best way to solve this problem is to
not overload on pointer-vs-integer types to begin with. He also not overload on pointer-vs-integer types to begin with. He also
offers a way to make your own magic NULL that will match pointers offers a way to make your own magic NULL that will match pointers
before it matches integers: before it matches integers:
</p>
<pre> <pre>
const // this is a const object... const // this is a const object...
class { class {
...@@ -77,7 +77,8 @@ ...@@ -77,7 +77,8 @@
// taken (see Item 27)... // taken (see Item 27)...
} NULL; // and whose name is NULL } NULL; // and whose name is NULL
</pre>(Cribbed from the published version of </pre>
<p>(Cribbed from the published version of
<a href="http://www.awlonline.com/cseng/meyerscddemo/">the <a href="http://www.awlonline.com/cseng/meyerscddemo/">the
Effective C++ CD</a>, reproduced here with permission.) Effective C++ CD</a>, reproduced here with permission.)
</p> </p>
...@@ -93,7 +94,7 @@ ...@@ -93,7 +94,7 @@
print this stuff, it prompted him to run this code through current print this stuff, it prompted him to run this code through current
compilers to see what the state of the art is with respect to member compilers to see what the state of the art is with respect to member
template functions. He posted template functions. He posted
<a href="http://www.deja.com/threadmsg_md.xp?AN=644660779.1&CONTEXT=964036823.871301239">an <a href="http://www.deja.com/threadmsg_md.xp?AN=644660779.1&amp;CONTEXT=964036823.871301239">an
article to Usenet</a> after discovering that the code above is not article to Usenet</a> after discovering that the code above is not
valid! Even though it has no data members, it still needs a valid! Even though it has no data members, it still needs a
user-defined constructor (which means that the class needs a type name user-defined constructor (which means that the class needs a type name
...@@ -105,14 +106,14 @@ ...@@ -105,14 +106,14 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="2">Implementation properties</a></h2> <h2><a name="2">Implementation properties</a></h2>
<p>
<h3><code>&lt;limits&gt;</code></h3> <h3><code>&lt;limits&gt;</code></h3>
This header mainly defines traits classes to give access to various <p>This header mainly defines traits classes to give access to various
implementation defined-aspects of the fundamental types. The implementation defined-aspects of the fundamental types. The
traits classes -- fourteen in total -- are all specilizations of the traits classes -- fourteen in total -- are all specilizations of the
template class <code>numeric_limits</code> defined as follows: template class <code>numeric_limits</code> defined as follows:
</p>
<pre> <pre>
template&lt;typename T&gt; struct class { template&lt;typename T&gt; struct class {
static const bool is_specialized; static const bool is_specialized;
...@@ -150,12 +151,11 @@ ...@@ -150,12 +151,11 @@
static const bool tinyness_before; static const bool tinyness_before;
static const float_round_style round_style; static const float_round_style round_style;
};</pre> };</pre>
</p>
<p>Return <a href="#top">to top of page</a> or <p>Return <a href="#top">to top of page</a> or
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="3">Start and Termination</a></h2> <h2><a name="3">Start and Termination</a></h2>
<p>Not many changes here to <code>&lt;cstdlib&gt;</code> (the old stdlib.h). <p>Not many changes here to <code>&lt;cstdlib&gt;</code> (the old stdlib.h).
You should note that the <code>abort()</code> function does not call You should note that the <code>abort()</code> function does not call
...@@ -166,11 +166,14 @@ ...@@ -166,11 +166,14 @@
</p> </p>
<p>The good old <code>exit()</code> function can be a bit funky, too, until <p>The good old <code>exit()</code> function can be a bit funky, too, until
you look closer. Basically, three points to remember are: you look closer. Basically, three points to remember are:
</p>
<ol> <ol>
<li>Static objects are destroyed in reverse order of their creation. <li>Static objects are destroyed in reverse order of their creation.
</li>
<li>Functions registered with <code>atexit()</code> are called in <li>Functions registered with <code>atexit()</code> are called in
reverse order of registration, once per registration call. reverse order of registration, once per registration call.
(This isn't actually new.) (This isn't actually new.)
</li>
<li>The previous two actions are &quot;interleaved,&quot; that is, <li>The previous two actions are &quot;interleaved,&quot; that is,
given this pseudocode: given this pseudocode:
<pre> <pre>
...@@ -181,12 +184,13 @@ ...@@ -181,12 +184,13 @@
atexit(f1); atexit(f1);
static Thing obj2; static Thing obj2;
atexit(f2); atexit(f2);
</pre>then at a call of <code>exit()</code>, f2 will be called, then </pre>
then at a call of <code>exit()</code>, f2 will be called, then
obj2 will be destroyed, then f1 will be called, and finally obj1 obj2 will be destroyed, then f1 will be called, and finally obj1
will be destroyed. If f1 or f2 allow an exception to propagate will be destroyed. If f1 or f2 allow an exception to propagate
out of them, Bad Things happen. out of them, Bad Things happen.
</li>
</ol> </ol>
</p>
<p>Note also that <code>atexit()</code> is only required to store 32 <p>Note also that <code>atexit()</code> is only required to store 32
functions, and the compiler/library might already be using some of functions, and the compiler/library might already be using some of
those slots. If you think you may run out, we recommend using those slots. If you think you may run out, we recommend using
...@@ -196,21 +200,22 @@ ...@@ -196,21 +200,22 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="4">Dynamic memory management</a></h2> <h2><a name="4">Dynamic memory management</a></h2>
<p>There are six flavors each of <code>new</code> and <code>delete</code>, so <p>There are six flavors each of <code>new</code> and <code>delete</code>, so
make certain that you're using the right ones! Here are quickie make certain that you're using the right ones! Here are quickie
descriptions of <code>new</code>: descriptions of <code>new</code>:
</p>
<ul> <ul>
<li>single object form, throwing a <code>bad_alloc</code> on errors; <li>single object form, throwing a <code>bad_alloc</code> on errors;
this is what most people are used to using this is what most people are used to using</li>
<li>single object &quot;nothrow&quot; form, returning NULL on errors <li>single object &quot;nothrow&quot; form, returning NULL on errors</li>
<li>array new, throwing <code>bad_alloc</code> on errors <li>array new, throwing <code>bad_alloc</code> on errors</li>
<li>array nothrow new, returning NULL on errors <li>array nothrow new, returning NULL on errors</li>
<li>placement new, which does nothing (like it's supposed to) <li>placement new, which does nothing (like it's supposed to)</li>
<li>placement array new, which also does nothing <li>placement array new, which also does nothing</li>
</ul> </ul>
They are distinguished by the parameters that you pass to them, like <p>They are distinguished by the parameters that you pass to them, like
any other overloaded function. The six flavors of <code>delete</code> any other overloaded function. The six flavors of <code>delete</code>
are distinguished the same way, but none of them are allowed to throw are distinguished the same way, but none of them are allowed to throw
an exception under any circumstances anyhow. (They match up for an exception under any circumstances anyhow. (They match up for
...@@ -225,6 +230,7 @@ ...@@ -225,6 +230,7 @@
<code>bad_alloc</code> exception (or, technically, some class derived <code>bad_alloc</code> exception (or, technically, some class derived
from it). You can change this by writing your own function (called a from it). You can change this by writing your own function (called a
new-handler) and then registering it with <code>set_new_handler()</code>: new-handler) and then registering it with <code>set_new_handler()</code>:
</p>
<pre> <pre>
typedef void (*PFV)(void); typedef void (*PFV)(void);
...@@ -248,7 +254,6 @@ ...@@ -248,7 +254,6 @@
... ...
} }
</pre> </pre>
</p>
<p><code>bad_alloc</code> is derived from the base <code>exception</code> <p><code>bad_alloc</code> is derived from the base <code>exception</code>
class defined in Chapter 19. class defined in Chapter 19.
</p> </p>
...@@ -256,7 +261,7 @@ ...@@ -256,7 +261,7 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="5">RTTI, the ABI, and demangling</a></h2> <h2><a name="5">RTTI, the ABI, and demangling</a></h2>
<p>If you have read the <a href="../documentation.html#4">source <p>If you have read the <a href="../documentation.html#4">source
documentation</a> for <code> namespace abi </code> then you are aware documentation</a> for <code> namespace abi </code> then you are aware
...@@ -271,6 +276,7 @@ ...@@ -271,6 +276,7 @@
<p>Probably the only times you'll be interested in demangling at runtime <p>Probably the only times you'll be interested in demangling at runtime
are when you're seeing <code>typeid</code> strings in RTTI, or when are when you're seeing <code>typeid</code> strings in RTTI, or when
you're handling the runtime-support exception classes. For example: you're handling the runtime-support exception classes. For example:
</p>
<pre> <pre>
#include &lt;exception&gt; #include &lt;exception&gt;
#include &lt;iostream&gt; #include &lt;iostream&gt;
...@@ -304,11 +310,12 @@ int main() ...@@ -304,11 +310,12 @@ int main()
free(realname); free(realname);
return 0; return 0;
}</pre></p> }</pre>
<p>With GCC 3.1 and later, this prints<pre> <p>With GCC 3.1 and later, this prints
St13bad_exception =&gt; std::bad_exception : 0
3barI5emptyLi17EE =&gt; bar&lt;empty, 17&gt; : 0</pre>
</p> </p>
<pre>
St13bad_exception =&gt; std::bad_exception : 0
3barI5emptyLi17EE =&gt; bar&lt;empty, 17&gt; : 0 </pre>
<p>The demangler interface is described in the source documentation <p>The demangler interface is described in the source documentation
linked to above. It is actually written in C, so you don't need to linked to above. It is actually written in C, so you don't need to
be writing C++ in order to demangle C++. (That also means we have to be writing C++ in order to demangle C++. (That also means we have to
...@@ -322,7 +329,7 @@ int main() ...@@ -322,7 +329,7 @@ int main()
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<p class="fineprint"><em> <p class="fineprint"><em>
See <a href="../17_intro/license.html">license.html</a> for copying conditions. See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to Comments and suggestions are welcome, and may be sent to
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)"> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
<meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL"> <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL" />
<meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 19."> <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 19." />
<meta name="GENERATOR" content="vi and eight fingers"> <meta name="GENERATOR" content="vi and eight fingers" />
<title>libstdc++-v3 HOWTO: Chapter 19</title> <title>libstdc++-v3 HOWTO: Chapter 19</title>
<link rel="StyleSheet" href="../lib3styles.css"> <link rel="StyleSheet" href="../lib3styles.css" />
</head> </head>
<body> <body>
...@@ -20,16 +19,16 @@ ...@@ -20,16 +19,16 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<h1>Contents</h1> <h1>Contents</h1>
<ul> <ul>
<li><a href="#1">Adding data to exceptions</a> <li><a href="#1">Adding data to exceptions</a></li>
<li><a href="#2">Exception class hierarchy diagram</a> <li><a href="#2">Exception class hierarchy diagram</a></li>
<li><a href="#3">Concept checkers -- <strong>new and improved!</strong></a> <li><a href="#3">Concept checkers -- <strong>new and improved!</strong></a></li>
<li><a href="#4">Verbose <code>terminate</code></a> <li><a href="#4">Verbose <code>terminate</code></a></li>
</ul> </ul>
<hr> <hr />
<!-- ####################################################### --> <!-- ####################################################### -->
...@@ -56,7 +55,7 @@ ...@@ -56,7 +55,7 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="2">Exception class hierarchy diagram</a></h2> <h2><a name="2">Exception class hierarchy diagram</a></h2>
<p>At one point we were going to make up a PDF of the exceptions <p>At one point we were going to make up a PDF of the exceptions
hierarchy, akin to the one done for the I/O class hierarchy. hierarchy, akin to the one done for the I/O class hierarchy.
...@@ -72,7 +71,7 @@ ...@@ -72,7 +71,7 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="3">Concept checkers -- <strong>new and improved!</strong></a></h2> <h2><a name="3">Concept checkers -- <strong>new and improved!</strong></a></h2>
<p>Better taste! Less fat! Literally!</p> <p>Better taste! Less fat! Literally!</p>
<p>In 1999, SGI added <em>concept checkers</em> to their implementation <p>In 1999, SGI added <em>concept checkers</em> to their implementation
...@@ -89,7 +88,7 @@ ...@@ -89,7 +88,7 @@
were found in it on more than one occasion. were found in it on more than one occasion.
</p> </p>
<p>The primary author of the checking code, Jeremy Siek, had already <p>The primary author of the checking code, Jeremy Siek, had already
started work on a replcement implementation. The new code has been started work on a replacement implementation. The new code has been
formally reviewed and accepted into formally reviewed and accepted into
<a href="http://www.boost.org/libs/concept_check/concept_check.htm">the <a href="http://www.boost.org/libs/concept_check/concept_check.htm">the
Boost libraries</a>, and we are pleased to incorporate it into the Boost libraries</a>, and we are pleased to incorporate it into the
...@@ -109,11 +108,12 @@ ...@@ -109,11 +108,12 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="4">Verbose <code>terminate</code></a></h2> <h2><a name="4">Verbose <code>terminate</code></a></h2>
<p>If you are having difficulty with uncaught exceptions and want a <p>If you are having difficulty with uncaught exceptions and want a
little bit of help debugging the causes of the core dumps, you can little bit of help debugging the causes of the core dumps, you can
make use of a GNU extension in GCC 3.1 and later: make use of a GNU extension in GCC 3.1 and later:
</p>
<pre> <pre>
#include &lt;exception&gt; #include &lt;exception&gt;
...@@ -123,7 +123,6 @@ ...@@ -123,7 +123,6 @@
... ...
throw <em>anything</em>; throw <em>anything</em>;
}</pre> }</pre>
</p>
<p>The <code> __verbose_terminate_handler </code> function obtains the name <p>The <code> __verbose_terminate_handler </code> function obtains the name
of the current exception, attempts to demangle it, and prints it to of the current exception, attempts to demangle it, and prints it to
stderr. If the exception is derived from <code> std::exception </code> stderr. If the exception is derived from <code> std::exception </code>
...@@ -133,6 +132,7 @@ ...@@ -133,6 +132,7 @@
without returning; this one calls abort. without returning; this one calls abort.
</p> </p>
<p>For example: <p>For example:
</p>
<pre> <pre>
#include &lt;exception&gt; #include &lt;exception&gt;
#include &lt;stdexcept&gt; #include &lt;stdexcept&gt;
...@@ -151,8 +151,8 @@ ...@@ -151,8 +151,8 @@
else else
throw argc; throw argc;
}</pre> }</pre>
</p>
<p>In GCC 3.1 and later, this gives <p>In GCC 3.1 and later, this gives
</p>
<pre> <pre>
% ./a.out % ./a.out
terminate called after throwing a `int' terminate called after throwing a `int'
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
what(): argc is greater than 5! what(): argc is greater than 5!
Aborted Aborted
%</pre> %</pre>
The 'Aborted' line comes from the call to abort(), of course. <p>The 'Aborted' line comes from the call to abort(), of course.
</p> </p>
<p>Return <a href="#top">to top of page</a> or <p>Return <a href="#top">to top of page</a> or
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<p class="fineprint"><em> <p class="fineprint"><em>
See <a href="../17_intro/license.html">license.html</a> for copying conditions. See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to Comments and suggestions are welcome, and may be sent to
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)"> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
<meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL"> <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL" />
<meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 20."> <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 20." />
<meta name="GENERATOR" content="vi and eight fingers"> <meta name="GENERATOR" content="vi and eight fingers" />
<title>libstdc++-v3 HOWTO: Chapter 20</title> <title>libstdc++-v3 HOWTO: Chapter 20</title>
<link rel="StyleSheet" href="../lib3styles.css"> <link rel="StyleSheet" href="../lib3styles.css" />
</head> </head>
<body> <body>
...@@ -19,16 +18,16 @@ ...@@ -19,16 +18,16 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<h1>Contents</h1> <h1>Contents</h1>
<ul> <ul>
<li><a href="#1"><code>auto_ptr</code> is not omnipotent</a> <li><a href="#1"><code>auto_ptr</code> is not omnipotent</a></li>
<li><a href="#2"><code>auto_ptr</code> inside container classes</a> <li><a href="#2"><code>auto_ptr</code> inside container classes</a></li>
<li><a href="#3">Functors</a> <li><a href="#3">Functors</a></li>
<li><a href="#4">Pairs</a> <li><a href="#4">Pairs</a></li>
</ul> </ul>
<hr> <hr />
<!-- ####################################################### --> <!-- ####################################################### -->
...@@ -47,6 +46,7 @@ ...@@ -47,6 +46,7 @@
</p> </p>
<p>AP <em>is</em> meant to prevent nasty leaks in the presence of <p>AP <em>is</em> meant to prevent nasty leaks in the presence of
exceptions. That's <em>all</em>. This code is AP-friendly: exceptions. That's <em>all</em>. This code is AP-friendly:
</p>
<pre> <pre>
// not a recommend naming scheme, but good for web-based FAQs // not a recommend naming scheme, but good for web-based FAQs
typedef std::auto_ptr&lt;MyClass&gt; APMC; typedef std::auto_ptr&lt;MyClass&gt; APMC;
...@@ -62,21 +62,24 @@ ...@@ -62,21 +62,24 @@
function_taking_MyClass_pointer (ap.get()); function_taking_MyClass_pointer (ap.get());
} }
</pre>When an exception gets thrown, the instance of MyClass that's </pre>
<p>When an exception gets thrown, the instance of MyClass that's
been created on the heap will be <code>delete</code>'d as the stack is been created on the heap will be <code>delete</code>'d as the stack is
unwound past <code>func()</code>. unwound past <code>func()</code>.
</p> </p>
<p>Changing that code as follows is <em>not</em> AP-friendly: <p>Changing that code as follows is <em>not</em> AP-friendly:
</p>
<pre> <pre>
APMC ap (new MyClass[22]); APMC ap (new MyClass[22]);
</pre>You will get the same problems as you would without the use </pre>
<p>You will get the same problems as you would without the use
of AP: of AP:
</p>
<pre> <pre>
char* array = new char[10]; // array new... char* array = new char[10]; // array new...
... ...
delete array; // ...but single-object delete delete array; // ...but single-object delete
</pre> </pre>
</p>
<p>AP cannot tell whether the pointer you've passed at creation points <p>AP cannot tell whether the pointer you've passed at creation points
to one or many things. If it points to many things, you are about to one or many things. If it points to many things, you are about
to die. AP is trivial to write, however, so you could write your to die. AP is trivial to write, however, so you could write your
...@@ -87,18 +90,19 @@ ...@@ -87,18 +90,19 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="2"><code>auto_ptr</code> inside container classes</a></h2> <h2><a name="2"><code>auto_ptr</code> inside container classes</a></h2>
<p>All of the <a href="../23_containers/howto.html">containers</a> <p>All of the <a href="../23_containers/howto.html">containers</a>
described in the standard library require their contained types described in the standard library require their contained types
to have, among other things, a copy constructor like this: to have, among other things, a copy constructor like this:
</p>
<pre> <pre>
struct My_Type struct My_Type
{ {
My_Type (My_Type const&amp;); My_Type (My_Type const&amp;);
}; };
</pre> </pre>
Note the const keyword; the object being copied shouldn't change. <p>Note the const keyword; the object being copied shouldn't change.
The template class <code>auto_ptr</code> (called AP here) does not The template class <code>auto_ptr</code> (called AP here) does not
meet this requirement. Creating a new AP by copying an existing meet this requirement. Creating a new AP by copying an existing
one transfers ownership of the pointed-to object, which means that one transfers ownership of the pointed-to object, which means that
...@@ -113,6 +117,7 @@ ...@@ -113,6 +117,7 @@
<a href="../19_diagnostics/howto.html#3">concept checks</a> built <a href="../19_diagnostics/howto.html#3">concept checks</a> built
in to this implementation will issue an error if you try to in to this implementation will issue an error if you try to
compile code like this: compile code like this:
</p>
<pre> <pre>
#include &lt;vector&gt; #include &lt;vector&gt;
#include &lt;memory&gt; #include &lt;memory&gt;
...@@ -122,13 +127,13 @@ ...@@ -122,13 +127,13 @@
std::vector&lt; std::auto_ptr&lt;int&gt; &gt; vec_ap_int; std::vector&lt; std::auto_ptr&lt;int&gt; &gt; vec_ap_int;
} }
</pre> </pre>
Should you try this with the checks enabled, you will see an error. <p>Should you try this with the checks enabled, you will see an error.
</p> </p>
<p>Return <a href="#top">to top of page</a> or <p>Return <a href="#top">to top of page</a> or
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="3">Functors</a></h2> <h2><a name="3">Functors</a></h2>
<p>If you don't know what functors are, you're not alone. Many people <p>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 get slightly the wrong idea. In the interest of not reinventing
...@@ -141,7 +146,7 @@ ...@@ -141,7 +146,7 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="4">Pairs</a></h2> <h2><a name="4">Pairs</a></h2>
<p>The <code>pair&lt;T1,T2&gt;</code> is a simple and handy way to <p>The <code>pair&lt;T1,T2&gt;</code> is a simple and handy way to
carry around a pair of objects. One is of type T1, and another of carry around a pair of objects. One is of type T1, and another of
...@@ -151,16 +156,20 @@ ...@@ -151,16 +156,20 @@
</p> </p>
<p>Construction is simple. The default ctor initializes each member <p>Construction is simple. The default ctor initializes each member
with its respective default ctor. The other simple ctor, with its respective default ctor. The other simple ctor,
</p>
<pre> <pre>
pair (const T1&amp; x, const T2&amp; y); pair (const T1&amp; x, const T2&amp; y);
</pre>does what you think it does, <code>first</code> getting <code>x</code> </pre>
<p>does what you think it does, <code>first</code> getting <code>x</code>
and <code>second</code> getting <code>y</code>. and <code>second</code> getting <code>y</code>.
</p> </p>
<p>There is a copy constructor, but it requires that your compiler <p>There is a copy constructor, but it requires that your compiler
handle member function templates: handle member function templates:
</p>
<pre> <pre>
template &lt;class U, class V&gt; pain (const pair&lt;U,V&gt;&amp; p); template &lt;class U, class V&gt; pain (const pair&lt;U,V&gt;&amp; p);
</pre>The compiler will convert as necessary from U to T1 and from </pre>
<p>The compiler will convert as necessary from U to T1 and from
V to T2 in order to perform the respective initializations. V to T2 in order to perform the respective initializations.
</p> </p>
<p>The comparison operators are done for you. Equality <p>The comparison operators are done for you. Equality
...@@ -170,24 +179,25 @@ ...@@ -170,24 +179,25 @@
<code>operator==</code> functions (for types like MyClass) or builtin <code>operator==</code> functions (for types like MyClass) or builtin
comparisons (for types like int, char, etc). comparisons (for types like int, char, etc).
</p> </p>
<a name="pairlt"> <p><a name="pairlt">
<p>The less-than operator is a bit odd the first time you see it. It The less-than operator is a bit odd the first time you see it. It
is defined as evaluating to: is defined as evaluating to:
</a>
</p>
<pre> <pre>
x.first &lt; y.first || x.first &lt; y.first ||
( !(y.first &lt; x.first) &amp;&amp; x.second &lt; y.second ) ( !(y.first &lt; x.first) &amp;&amp; x.second &lt; y.second )
</pre> </pre>
The other operators are not defined using the <code>rel_ops</code> <p>The other operators are not defined using the <code>rel_ops</code>
functions above, but their semantics are the same. functions above, but their semantics are the same.
</p> </p>
</a>
<p>Finally, there is a template function called <code>make_pair</code> <p>Finally, there is a template function called <code>make_pair</code>
that takes two references-to-const objects and returns an that takes two references-to-const objects and returns an
instance of a pair instantiated on their respective types: instance of a pair instantiated on their respective types:
</p>
<pre> <pre>
pair&lt;int,MyClass&gt; p = make_pair(4,myobject); pair&lt;int,MyClass&gt; p = make_pair(4,myobject);
</pre> </pre>
</p>
<p>Return <a href="#top">to top of page</a> or <p>Return <a href="#top">to top of page</a> or
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
...@@ -197,7 +207,7 @@ ...@@ -197,7 +207,7 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<p class="fineprint"><em> <p class="fineprint"><em>
See <a href="../17_intro/license.html">license.html</a> for copying conditions. See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to Comments and suggestions are welcome, and may be sent to
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <html>
<head> <head>
<title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
Notes on the ctype implementation. <meta name="AUTHOR" content="bkoz@redhat.com (Benjamin Kosnik)" />
</title> <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL" />
<meta name="DESCRIPTION" content="Notes on the ctype implementation." />
<title>Notes on the ctype implementation.</title>
<link rel="StyleSheet" href="../lib3styles.css" />
</head> </head>
<body> <body>
<h1> <h1>
Notes on the ctype implementation. Notes on the ctype implementation.
</h1> </h1>
<I> <em>
prepared by Benjamin Kosnik (bkoz@redhat.com) on August 30, 2000 prepared by Benjamin Kosnik (bkoz@redhat.com) on August 30, 2000
</I> </em>
<p>
<h2> <h2>
1. Abstract 1. Abstract
</h2> </h2>
...@@ -21,13 +22,11 @@ prepared by Benjamin Kosnik (bkoz@redhat.com) on August 30, 2000 ...@@ -21,13 +22,11 @@ prepared by Benjamin Kosnik (bkoz@redhat.com) on August 30, 2000
Woe is me. Woe is me.
</p> </p>
<p>
<h2> <h2>
2. What the standard says 2. What the standard says
</h2> </h2>
<p>
<h2> <h2>
3. Problems with &quot;C&quot; ctype : global locales, termination. 3. Problems with &quot;C&quot; ctype : global locales, termination.
</h2> </h2>
...@@ -37,8 +36,8 @@ For the required specialization codecvt&lt;wchar_t, char, mbstate_t&gt; , ...@@ -37,8 +36,8 @@ For the required specialization codecvt&lt;wchar_t, char, mbstate_t&gt; ,
conversions are made between the internal character set (always UCS4 conversions are made between the internal character set (always UCS4
on GNU/Linux) and whatever the currently selected locale for the on GNU/Linux) and whatever the currently selected locale for the
LC_CTYPE category implements. LC_CTYPE category implements.
</p>
<p>
<h2> <h2>
4. Design 4. Design
</h2> </h2>
...@@ -48,24 +47,28 @@ The two required specializations are implemented as follows: ...@@ -48,24 +47,28 @@ The two required specializations are implemented as follows:
<code> <code>
ctype&lt;char&gt; ctype&lt;char&gt;
</code> </code>
</p>
<p> <p>
This is simple specialization. Implementing this was a piece of cake. This is simple specialization. Implementing this was a piece of cake.
</p>
<p> <p>
<code> <code>
ctype&lt;wchar_t&gt; ctype&lt;wchar_t&gt;
</code> </code>
</p>
<p> <p>
This specialization, by specifying all the template parameters, pretty This specialization, by specifying all the template parameters, pretty
much ties the hands of implementors. As such, the implementation is much ties the hands of implementors. As such, the implementation is
straightforward, involving mcsrtombs for the conversions between char straightforward, involving mcsrtombs for the conversions between char
to wchar_t and wcsrtombs for conversions between wchar_t and char. to wchar_t and wcsrtombs for conversions between wchar_t and char.
</p>
<p> <p>
Neither of these two required specializations deals with Unicode Neither of these two required specializations deals with Unicode
characters. As such, libstdc++-v3 implements characters. As such, libstdc++-v3 implements
</p>
<p>
<h2> <h2>
5. Examples 5. Examples
</h2> </h2>
...@@ -76,50 +79,47 @@ characters. As such, libstdc++-v3 implements ...@@ -76,50 +79,47 @@ characters. As such, libstdc++-v3 implements
More information can be found in the following testcases: More information can be found in the following testcases:
<ul> <ul>
<li> testsuite/22_locale/ctype_char_members.cc <li> testsuite/22_locale/ctype_char_members.cc </li>
<li> testsuite/22_locale/ctype_wchar_t_members.cc <li> testsuite/22_locale/ctype_wchar_t_members.cc </li>
</ul> </ul>
<p>
<h2> <h2>
6. Unresolved Issues 6. Unresolved Issues
</h2> </h2>
<ul> <ul>
<li> how to deal with the global locale issue? <li> how to deal with the global locale issue? </li>
<li> how to deal with different types than char, wchar_t? <li> how to deal with different types than char, wchar_t? </li>
<li> codecvt/ctype overlap: narrow/widen <li> codecvt/ctype overlap: narrow/widen </li>
<li> mask typedef in codecvt_base, argument types in codecvt. <li> mask typedef in codecvt_base, argument types in codecvt.
what is know about this type? what is know about this type? </li>
<li> why mask* argument in codecvt? <li> why mask* argument in codecvt? </li>
<li> can this be made (more) generic? is there a simple way to <li> can this be made (more) generic? is there a simple way to
straighten out the configure-time mess that is a by-product of straighten out the configure-time mess that is a by-product of
this class? this class? </li>
<li> get the ctype&lt;wchar_t&gt;::mask stuff under control. Need to <li> get the ctype&lt;wchar_t&gt;::mask stuff under control. Need to
make some kind of static table, and not do lookup evertime make some kind of static table, and not do lookup evertime
somebody hits the do_is... functions. Too bad we can't just somebody hits the do_is... functions. Too bad we can't just
redefine mask for ctype&lt;wchar_t&gt; redefine mask for ctype&lt;wchar_t&gt; </li>
<li> rename abstract base class. See if just smash-overriding <li> rename abstract base class. See if just smash-overriding
is a better approach. Clarify, add sanity to naming. is a better approach. Clarify, add sanity to naming. </li>
</ul> </ul>
<p>
<h2> <h2>
7. Acknowledgments 7. Acknowledgments
</h2> </h2>
Ulrich Drepper for patient answering of late-night questions, skeletal Ulrich Drepper for patient answering of late-night questions, skeletal
examples, and C language expertise. examples, and C language expertise.
<p>
<h2> <h2>
8. Bibliography / Referenced Documents 8. Bibliography / Referenced Documents
</h2> </h2>
...@@ -128,23 +128,29 @@ Drepper, Ulrich, GNU libc (glibc) 2.2 manual. In particular, Chapters &quot;6. C ...@@ -128,23 +128,29 @@ Drepper, Ulrich, GNU libc (glibc) 2.2 manual. In particular, Chapters &quot;6. C
<p> <p>
Drepper, Ulrich, Numerous, late-night email correspondence Drepper, Ulrich, Numerous, late-night email correspondence
</p>
<p> <p>
ISO/IEC 14882:1998 Programming languages - C++ ISO/IEC 14882:1998 Programming languages - C++
</p>
<p> <p>
ISO/IEC 9899:1999 Programming languages - C ISO/IEC 9899:1999 Programming languages - C
</p>
<p> <p>
Langer, Angelika and Klaus Kreft, Standard C++ IOStreams and Locales, Advanced Programmer's Guide and Reference, Addison Wesley Longman, Inc. 2000 Langer, Angelika and Klaus Kreft, Standard C++ IOStreams and Locales, Advanced Programmer's Guide and Reference, Addison Wesley Longman, Inc. 2000
</p>
<p> <p>
Stroustrup, Bjarne, Appendix D, The C++ Programming Language, Special Edition, Addison Wesley, Inc. 2000 Stroustrup, Bjarne, Appendix D, The C++ Programming Language, Special Edition, Addison Wesley, Inc. 2000
</p>
<p> <p>
System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x) System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
The Open Group/The Institute of Electrical and Electronics Engineers, Inc. The Open Group/The Institute of Electrical and Electronics Engineers, Inc.
http://www.opennc.org/austin/docreg.html http://www.opennc.org/austin/docreg.html
</p>
</body> </body>
</html> </html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)"> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
<meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL"> <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL" />
<meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 22."> <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 22." />
<meta name="GENERATOR" content="vi and eight fingers"> <meta name="GENERATOR" content="vi and eight fingers" />
<title>libstdc++-v3 HOWTO: Chapter 22</title> <title>libstdc++-v3 HOWTO: Chapter 22</title>
<link rel="StyleSheet" href="../lib3styles.css"> <link rel="StyleSheet" href="../lib3styles.css" />
</head> </head>
<body> <body>
...@@ -16,33 +15,33 @@ ...@@ -16,33 +15,33 @@
<p>Chapter 22 deals with the C++ localization facilities. <p>Chapter 22 deals with the C++ localization facilities.
</p> </p>
<!-- I wanted to write that sentence in something requiring an exotic font, <!-- I wanted to write that sentence in something requiring an exotic font,
like Cryllic or Kanji. Probably more work than such cuteness is worth, like Cyrllic or Kanji. Probably more work than such cuteness is worth,
but I still think it'd be funny. but I still think it'd be funny.
--> -->
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<h1>Contents</h1> <h1>Contents</h1>
<ul> <ul>
<li><a href="#1">class locale</a> <li><a href="#1">class locale</a></li>
<li><a href="#2">class codecvt</a> <li><a href="#2">class codecvt</a></li>
<li><a href="#3">class ctype</a> <li><a href="#3">class ctype</a></li>
<li><a href="#4">class messages</a> <li><a href="#4">class messages</a></li>
<li><a href="#5">Bjarne Stroustrup on Locales</a> <li><a href="#5">Bjarne Stroustrup on Locales</a></li>
<li><a href="#6">Nathan Myers on Locales</a> <li><a href="#6">Nathan Myers on Locales</a></li>
<li><a href="#7">Correct Transformations</a> <li><a href="#7">Correct Transformations</a></li>
</ul> </ul>
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<h2><a name="1">class locale</a></h2> <h2><a name="1">class locale</a></h2>
<p>Notes made during the implementation of locales can be found <p>Notes made during the implementation of locales can be found
<a href="locale.html">here</a>. <a href="locale.html">here</a>.
</p> </p>
<hr> <hr />
<h2><a name="2">class codecvt</a></h2> <h2><a name="2">class codecvt</a></h2>
<p>Notes made during the implementation of codecvt can be found <p>Notes made during the implementation of codecvt can be found
<a href="codecvt.html">here</a>. <a href="codecvt.html">here</a>.
...@@ -66,19 +65,19 @@ ...@@ -66,19 +65,19 @@
implementation-provided extended functionality are given. implementation-provided extended functionality are given.
</blockquote> </blockquote>
<hr> <hr />
<h2><a name="3">class ctype</a></h2> <h2><a name="3">class ctype</a></h2>
<p>Notes made during the implementation of ctype can be found <p>Notes made during the implementation of ctype can be found
<a href="ctype.html">here</a>. <a href="ctype.html">here</a>.
</p> </p>
<hr> <hr />
<h2><a name="4">class messages</a></h2> <h2><a name="4">class messages</a></h2>
<p>Notes made during the implementation of messages can be found <p>Notes made during the implementation of messages can be found
<a href="messages.html">here</a>. <a href="messages.html">here</a>.
</p> </p>
<hr> <hr />
<h2><a name="5">Stroustrup on Locales</a></h2> <h2><a name="5">Stroustrup on Locales</a></h2>
<p>Dr. Bjarne Stroustrup has released a <p>Dr. Bjarne Stroustrup has released a
<a href="http://www.research.att.com/~bs/3rd_loc0.html">pointer</a> <a href="http://www.research.att.com/~bs/3rd_loc0.html">pointer</a>
...@@ -96,14 +95,14 @@ ...@@ -96,14 +95,14 @@
avoid it. avoid it.
</em></blockquote> </em></blockquote>
<hr> <hr />
<h2><a name="6">Nathan Myers on Locales</a></h2> <h2><a name="6">Nathan Myers on Locales</a></h2>
<p>An article entitled &quot;The Standard C++ Locale&quot; was <p>An article entitled &quot;The Standard C++ Locale&quot; was
published in Dr. Dobb's Journal and can be found published in Dr. Dobb's Journal and can be found
<a href="http://www.cantrip.org/locale.html">here</a>. <a href="http://www.cantrip.org/locale.html">here</a>.
</p> </p>
<hr> <hr />
<h2><a name="7">Correct Transformations</a></h2> <h2><a name="7">Correct Transformations</a></h2>
<!-- Jumping directly to here from chapter 21. --> <!-- Jumping directly to here from chapter 21. -->
<p>A very common question on newsgroups and mailing lists is, &quot;How <p>A very common question on newsgroups and mailing lists is, &quot;How
...@@ -207,7 +206,7 @@ ...@@ -207,7 +206,7 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<p class="fineprint"><em> <p class="fineprint"><em>
See <a href="../17_intro/license.html">license.html</a> for copying conditions. See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to Comments and suggestions are welcome, and may be sent to
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <html>
<head> <head>
<title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
Notes on the locale implementation. <meta name="AUTHOR" content="bkoz@redhat.com (Benjamin Kosnik)" />
</title> <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL" />
<meta name="DESCRIPTION" content="Notes on the locale implementation." />
<title>Notes on the locale implementation.</title>
<link rel="StyleSheet" href="../lib3styles.css" />
</head> </head>
<body> <body>
<h1> <h1>
Notes on the locale implementation. Notes on the locale implementation.
</h1> </h1>
<I> <em>
prepared by Benjamin Kosnik (bkoz@redhat.com) on August 8, 2001 prepared by Benjamin Kosnik (bkoz@redhat.com) on August 8, 2001
</I> </em>
<p>
<h2> <h2>
1. Abstract Describes the basic locale object, including nested 1. Abstract Describes the basic locale object, including nested
classes id, facet, and the reference-counted implementation object, classes id, facet, and the reference-counted implementation object,
...@@ -22,14 +23,12 @@ class _Impl. ...@@ -22,14 +23,12 @@ class _Impl.
<p> <p>
</p> </p>
<p>
<h2> <h2>
2. What the standard says 2. What the standard says
See Chapter 22 of the standard.
</h2> </h2>
See Chapter 22 of the standard.
<p>
<h2> <h2>
3. Problems with &quot;C&quot; locales : global locales, termination. 3. Problems with &quot;C&quot; locales : global locales, termination.
</h2> </h2>
...@@ -40,7 +39,7 @@ design ontop of POSIX and other relevant stanards, which include the ...@@ -40,7 +39,7 @@ design ontop of POSIX and other relevant stanards, which include the
Single Unix (nee X/Open.) Single Unix (nee X/Open.)
Because POSIX falls down so completely, portibility is an issue. Because POSIX falls down so completely, portibility is an issue.
<p> </p>
<h2> <h2>
4. Design 4. Design
...@@ -74,7 +73,6 @@ Provides an index for looking up specific facets. ...@@ -74,7 +73,6 @@ Provides an index for looking up specific facets.
class _Impl class _Impl
<p>
<h2> <h2>
5. Examples 5. Examples
</h2> </h2>
...@@ -85,43 +83,40 @@ class _Impl ...@@ -85,43 +83,40 @@ class _Impl
More information can be found in the following testcases: More information can be found in the following testcases:
<ul> <ul>
<li> testsuite/22_locale/ctype_char_members.cc <li> testsuite/22_locale/ctype_char_members.cc </li>
<li> testsuite/22_locale/ctype_wchar_t_members.cc <li> testsuite/22_locale/ctype_wchar_t_members.cc </li>
</ul> </ul>
<p>
<h2> <h2>
6. Unresolved Issues 6. Unresolved Issues
</h2> </h2>
<ul> <ul>
<li> locale -a displays available locales on linux <li> locale -a displays available locales on linux </li>
<li> locale initialization: at what point does _S_classic, <li> locale initialization: at what point does _S_classic,
_S_global get initialized? Can named locales assume this _S_global get initialized? Can named locales assume this
initialization has already taken place? initialization has already taken place? </li>
<li> document how named locales error check when filling data <li> document how named locales error check when filling data
members. Ie, a fr_FR locale that doesn't have members. Ie, a fr_FR locale that doesn't have
numpunct::truename(): does it use "true"? Or is it a blank numpunct::truename(): does it use "true"? Or is it a blank
string? What's the convention? string? What's the convention? </li>
<li> explain how locale aliasing happens. When does "de_DE" <li> explain how locale aliasing happens. When does "de_DE"
use "de" information? What is the rule for locales composed of use "de" information? What is the rule for locales composed of
just an ISO language code (say, "de") and locales with both an just an ISO language code (say, "de") and locales with both an
ISO language code and ISO country code (say, "de_DE"). ISO language code and ISO country code (say, "de_DE"). </li>
<li> what should non-required facet instantiations do? If the <li> what should non-required facet instantiations do? If the
generic implemenation is provided, then how to end-users generic implemenation is provided, then how to end-users
provide specializations? provide specializations? </li>
</ul> </ul>
<p>
<h2> <h2>
7. Acknowledgments 7. Acknowledgments
</h2> </h2>
<p>
<h2> <h2>
8. Bibliography / Referenced Documents 8. Bibliography / Referenced Documents
</h2> </h2>
...@@ -130,20 +125,31 @@ Drepper, Ulrich, GNU libc (glibc) 2.2 manual. In particular, Chapters &quot;6. C ...@@ -130,20 +125,31 @@ Drepper, Ulrich, GNU libc (glibc) 2.2 manual. In particular, Chapters &quot;6. C
<p> <p>
Drepper, Ulrich, Numerous, late-night email correspondence Drepper, Ulrich, Numerous, late-night email correspondence
</p>
<p> <p>
ISO/IEC 14882:1998 Programming languages - C++ ISO/IEC 14882:1998 Programming languages - C++
</p>
<p> <p>
ISO/IEC 9899:1999 Programming languages - C ISO/IEC 9899:1999 Programming languages - C
</p>
<p> <p>
Langer, Angelika and Klaus Kreft, Standard C++ IOStreams and Locales, Advanced Programmer's Guide and Reference, Addison Wesley Longman, Inc. 2000 Langer, Angelika and Klaus Kreft, Standard C++ IOStreams and Locales, Advanced Programmer's Guide and Reference, Addison Wesley Longman, Inc. 2000
</p>
<p> <p>
Stroustrup, Bjarne, Appendix D, The C++ Programming Language, Special Edition, Addison Wesley, Inc. 2000 Stroustrup, Bjarne, Appendix D, The C++ Programming Language, Special Edition, Addison Wesley, Inc. 2000
</p>
<p> <p>
System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x) System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
The Open Group/The Institute of Electrical and Electronics Engineers, Inc. The Open Group/The Institute of Electrical and Electronics Engineers, Inc.
http://www.opennc.org/austin/docreg.html http://www.opennc.org/austin/docreg.html
</p>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)"> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
<meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL"> <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL" />
<meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 23."> <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 23." />
<meta name="GENERATOR" content="vi and eight fingers"> <meta name="GENERATOR" content="vi and eight fingers" />
<title>libstdc++-v3 HOWTO: Chapter 23</title> <title>libstdc++-v3 HOWTO: Chapter 23</title>
<link rel="StyleSheet" href="../lib3styles.css"> <link rel="StyleSheet" href="../lib3styles.css" />
</head> </head>
<body> <body>
...@@ -18,19 +17,19 @@ ...@@ -18,19 +17,19 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<h1>Contents</h1> <h1>Contents</h1>
<ul> <ul>
<li><a href="#1">Making code unaware of the container/array difference</a> <li><a href="#1">Making code unaware of the container/array difference</a></li>
<li><a href="#2">Variable-sized bitmasks</a> <li><a href="#2">Variable-sized bitmasks</a></li>
<li><a href="#3">Containers and multithreading</a> <li><a href="#3">Containers and multithreading</a></li>
<li><a href="#4">&quot;Hinting&quot; during insertion</a> <li><a href="#4">&quot;Hinting&quot; during insertion</a></li>
<li><a href="#5">Bitmasks and string arguments</a> <li><a href="#5">Bitmasks and string arguments</a></li>
<li><a href="#6"><code>std::list::size()</code> is O(n)!</a> <li><a href="#6"><code>std::list::size()</code> is O(n)!</a></li>
<li><a href="#7">Space overhead management for vectors</a> <li><a href="#7">Space overhead management for vectors</a></li>
</ul> </ul>
<hr> <hr />
<!-- ####################################################### --> <!-- ####################################################### -->
...@@ -65,9 +64,10 @@ ...@@ -65,9 +64,10 @@
code size or execution time. code size or execution time.
</p> </p>
<p>The result is that if all your algorithm calls look like <p>The result is that if all your algorithm calls look like
</p>
<pre> <pre>
std::transform(beginof(foo), endof(foo), beginof(foo), SomeFunction);</pre> std::transform(beginof(foo), endof(foo), beginof(foo), SomeFunction);</pre>
then the type of foo can change from an array of ints to a vector <p>then the type of foo can change from an array of ints to a vector
of ints to a deque of ints and back again, without ever changing any of ints to a deque of ints and back again, without ever changing any
client code. client code.
</p> </p>
...@@ -86,17 +86,19 @@ ...@@ -86,17 +86,19 @@
give the extra three lines and avoid confusion. give the extra three lines and avoid confusion.
</p> </p>
<p>Second, the line <p>Second, the line
</p>
<pre> <pre>
inline unsigned int lengthof (T (&amp;)[sz]) { return sz; } </pre> inline unsigned int lengthof (T (&amp;)[sz]) { return sz; } </pre>
looks just weird! Hint: unused parameters can be left nameless. <p>looks just weird! Hint: unused parameters can be left nameless.
</p> </p>
<p>Return <a href="#top">to top of page</a> or <p>Return <a href="#top">to top of page</a> or
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="2">Variable-sized bitmasks</a></h2> <h2><a name="2">Variable-sized bitmasks</a></h2>
<p>No, you cannot write code of the form <p>No, you cannot write code of the form
</p>
<!-- Careful, the leading spaces in PRE show up directly. --> <!-- Careful, the leading spaces in PRE show up directly. -->
<pre> <pre>
#include &lt;bitset&gt; #include &lt;bitset&gt;
...@@ -106,19 +108,19 @@ ...@@ -106,19 +108,19 @@
std::bitset&lt;n&gt; bits; std::bitset&lt;n&gt; bits;
.... ....
} </pre> } </pre>
because <code>n</code> must be known at compile time. Your compiler is <p>because <code>n</code> must be known at compile time. Your compiler is
correct; it is not a bug. That's the way templates work. (Yes, it correct; it is not a bug. That's the way templates work. (Yes, it
<em>is</em> a feature.) <em>is</em> a feature.)
</p> </p>
<p>There are a couple of ways to handle this kind of thing. Please <p>There are a couple of ways to handle this kind of thing. Please
consider all of them before passing judgement. They include, in consider all of them before passing judgement. They include, in
no particular order: no particular order:
</p>
<ul> <ul>
<li>A very large N in <code>bitset&lt;N&gt;</code>. <li>A very large N in <code>bitset&lt;N&gt;</code>.</li>
<li>A container&lt;bool&gt;. <li>A container&lt;bool&gt;.</li>
<li>Extremely weird solutions. <li>Extremely weird solutions.</li>
</ul> </ul>
</p>
<p><strong>A very large N in <p><strong>A very large N in
<code>bitset&lt;N&gt;</code>.&nbsp;&nbsp;</strong> It has <code>bitset&lt;N&gt;</code>.&nbsp;&nbsp;</strong> It has
been pointed out a few times in newsgroups that N bits only takes up been pointed out a few times in newsgroups that N bits only takes up
...@@ -192,7 +194,7 @@ ...@@ -192,7 +194,7 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="3">Containers and multithreading</a></h2> <h2><a name="3">Containers and multithreading</a></h2>
<p>This section discusses issues surrounding the design of <p>This section discusses issues surrounding the design of
multithreaded applications which use Standard C++ containers. multithreaded applications which use Standard C++ containers.
...@@ -249,6 +251,7 @@ ...@@ -249,6 +251,7 @@
you must change this on a global basis for your platform to better you must change this on a global basis for your platform to better
support multi-threading, then please consult all commentary in support multi-threading, then please consult all commentary in
include/bits/stl_alloc.h and the allocators link below. include/bits/stl_alloc.h and the allocators link below.
</p>
<blockquote> <blockquote>
<p>(Explicit warning since so many people get confused while <p>(Explicit warning since so many people get confused while
attempting this:) attempting this:)
...@@ -272,7 +275,7 @@ ...@@ -272,7 +275,7 @@
problems. problems.
</p> </p>
</blockquote> </blockquote>
If you find any platform where gcc reports a <p>If you find any platform where gcc reports a
threading model other than single, and where libstdc++-v3 builds threading model other than single, and where libstdc++-v3 builds
a buggy container allocator when used with threads unless you a buggy container allocator when used with threads unless you
define __USE_MALLOC, we want to hear about it ASAP. In the define __USE_MALLOC, we want to hear about it ASAP. In the
...@@ -290,13 +293,14 @@ ...@@ -290,13 +293,14 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="4">&quot;Hinting&quot; during insertion</a></h2> <h2><a name="4">&quot;Hinting&quot; during insertion</a></h2>
<p>Section [23.1.2], Table 69, of the C++ standard lists this function <p>Section [23.1.2], Table 69, of the C++ standard lists this function
for all of the associative containers (map, set, etc): for all of the associative containers (map, set, etc):
</p>
<pre> <pre>
a.insert(p,t);</pre> a.insert(p,t);</pre>
where 'p' is an iterator into the container 'a', and 't' is the item <p>where 'p' is an iterator into the container 'a', and 't' is the item
to insert. The standard says that &quot;iterator p is a hint to insert. The standard says that &quot;iterator p is a hint
pointing to where the insert should start to search,&quot; but pointing to where the insert should start to search,&quot; but
specifies nothing more. (LWG Issue #233, currently in review, specifies nothing more. (LWG Issue #233, currently in review,
...@@ -321,23 +325,26 @@ ...@@ -321,23 +325,26 @@
their new meanings in the next paragraph. *grin* their new meanings in the next paragraph. *grin*
</p> </p>
<p>If the <code>hint</code> parameter ('p' above) is equivalent to: <p>If the <code>hint</code> parameter ('p' above) is equivalent to:
</p>
<ul> <ul>
<li><code>begin()</code>, then the item being inserted should have a key <li><code>begin()</code>, then the item being inserted should have a key
less than all the other keys in the container. The item will less than all the other keys in the container. The item will
be inserted at the beginning of the container, becoming the new be inserted at the beginning of the container, becoming the new
entry at <code>begin()</code>. entry at <code>begin()</code>.
</li>
<li><code>end()</code>, then the item being inserted should have a key <li><code>end()</code>, then the item being inserted should have a key
greater than all the other keys in the container. The item will greater than all the other keys in the container. The item will
be inserted at the end of the container, becoming the new entry be inserted at the end of the container, becoming the new entry
at <code>end()</code>. at <code>end()</code>.
</li>
<li>neither <code>begin()</code> nor <code>end()</code>, then: Let <code>h</code> <li>neither <code>begin()</code> nor <code>end()</code>, then: Let <code>h</code>
be the entry in the container pointed to by <code>hint</code>, that be the entry in the container pointed to by <code>hint</code>, that
is, <code>h = *hint</code>. Then the item being inserted should have is, <code>h = *hint</code>. Then the item being inserted should have
a key less than that of <code>h</code>, and greater than that of the a key less than that of <code>h</code>, and greater than that of the
item preceding <code>h</code>. The new item will be inserted item preceding <code>h</code>. The new item will be inserted
between <code>h</code> and <code>h</code>'s predecessor. between <code>h</code> and <code>h</code>'s predecessor.
</li>
</ul> </ul>
</p>
<p>For <code>multimap</code> and <code>multiset</code>, the restrictions are <p>For <code>multimap</code> and <code>multiset</code>, the restrictions are
slightly looser: &quot;greater than&quot; should be replaced by slightly looser: &quot;greater than&quot; should be replaced by
&quot;not less than&quot; and &quot;less than&quot; should be replaced &quot;not less than&quot; and &quot;less than&quot; should be replaced
...@@ -372,7 +379,7 @@ ...@@ -372,7 +379,7 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="5">Bitmasks and string arguments</a></h2> <h2><a name="5">Bitmasks and string arguments</a></h2>
<p>Bitmasks do not take char* nor const char* arguments in their <p>Bitmasks do not take char* nor const char* arguments in their
constructors. This is something of an accident, but you can read constructors. This is something of an accident, but you can read
...@@ -383,6 +390,7 @@ ...@@ -383,6 +390,7 @@
</p> </p>
<p>For now you can simply make a temporary string object using the <p>For now you can simply make a temporary string object using the
constructor expression: constructor expression:
</p>
<pre> <pre>
std::bitset&lt;5&gt; b ( std::string(&quot;10110&quot;) ); std::bitset&lt;5&gt; b ( std::string(&quot;10110&quot;) );
</pre> </pre>
...@@ -390,16 +398,16 @@ ...@@ -390,16 +398,16 @@
<pre> <pre>
std::bitset&lt;5&gt; b ( &quot;10110&quot; ); // invalid std::bitset&lt;5&gt; b ( &quot;10110&quot; ); // invalid
</pre> </pre>
</p>
<p>Return <a href="#top">to top of page</a> or <p>Return <a href="#top">to top of page</a> or
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="6"><code>std::list::size()</code> is O(n)!</a></h2> <h2><a name="6"><code>std::list::size()</code> is O(n)!</a></h2>
<p>Yes it is, and that's okay. This is a decision that we preserved when <p>Yes it is, and that's okay. This is a decision that we preserved when
we imported SGI's STL implementation. The following is quoted from we imported SGI's STL implementation. The following is quoted from
<a href="http://www.sgi.com/tech/stl/FAQ.html">their FAQ</a>: <a href="http://www.sgi.com/tech/stl/FAQ.html">their FAQ</a>:
</p>
<blockquote> <blockquote>
<p>The size() member function, for list and slist, takes time <p>The size() member function, for list and slist, takes time
proportional to the number of elements in the list. This was a proportional to the number of elements in the list. This was a
...@@ -419,6 +427,7 @@ ...@@ -419,6 +427,7 @@
is supposed to do something unless there is a good reason not to. is supposed to do something unless there is a good reason not to.
</p> </p>
<p>One implication of linear time size(): you should never write <p>One implication of linear time size(): you should never write
</p>
<pre> <pre>
if (L.size() == 0) if (L.size() == 0)
...</pre> ...</pre>
...@@ -426,15 +435,13 @@ ...@@ -426,15 +435,13 @@
<pre> <pre>
if (L.empty()) if (L.empty())
...</pre> ...</pre>
</p>
</blockquote> </blockquote>
</p>
<p>Return <a href="#top">to top of page</a> or <p>Return <a href="#top">to top of page</a> or
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="7">Space overhead management for vectors</h2> <h2><a name="7">Space overhead management for vectors</a></h2>
<p>In <p>In
<a href="http://gcc.gnu.org/ml/libstdc++/2002-04/msg00105.html">this <a href="http://gcc.gnu.org/ml/libstdc++/2002-04/msg00105.html">this
message to the list</a>, Daniel Kostecky announced work on an message to the list</a>, Daniel Kostecky announced work on an
...@@ -457,7 +464,7 @@ ...@@ -457,7 +464,7 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<p class="fineprint"><em> <p class="fineprint"><em>
See <a href="../17_intro/license.html">license.html</a> for copying conditions. See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to Comments and suggestions are welcome, and may be sent to
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)"> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
<meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL"> <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL" />
<meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 24."> <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 24." />
<meta name="GENERATOR" content="vi and eight fingers"> <meta name="GENERATOR" content="vi and eight fingers" />
<title>libstdc++-v3 HOWTO: Chapter 24</title> <title>libstdc++-v3 HOWTO: Chapter 24</title>
<link rel="StyleSheet" href="../lib3styles.css"> <link rel="StyleSheet" href="../lib3styles.css" />
</head> </head>
<body> <body>
...@@ -19,14 +18,14 @@ ...@@ -19,14 +18,14 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<h1>Contents</h1> <h1>Contents</h1>
<ul> <ul>
<li><a href="#1">They ain't pointers!</a> <li><a href="#1">They ain't pointers!</a></li>
<li><a href="#2">It ends <em>where?</em></a> <li><a href="#2">It ends <em>where?</em></a></li>
</ul> </ul>
<hr> <hr />
<!-- ####################################################### --> <!-- ####################################################### -->
...@@ -67,40 +66,45 @@ ...@@ -67,40 +66,45 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="2">It ends <em>where?</em></a></h2> <h2><a name="2">It ends <em>where?</em></a></h2>
<p>This starts off sounding complicated, but is actually very easy, <p>This starts off sounding complicated, but is actually very easy,
especially towards the end. Trust me. especially towards the end. Trust me.
</p> </p>
<p>Beginners usually have a little trouble understand the whole <p>Beginners usually have a little trouble understand the whole
'past-the-end' thing, until they remember their early algebra classes 'past-the-end' thing, until they remember their early algebra classes
(see, they </em>told</em> you that stuff would come in handy!) and (see, they <em>told</em> you that stuff would come in handy!) and
the concept of half-open ranges. the concept of half-open ranges.
</p> </p>
<p>First, some history, and a reminder of some of the funkier rules in <p>First, some history, and a reminder of some of the funkier rules in
C and C++ for builtin arrays. The following rules have always been C and C++ for builtin arrays. The following rules have always been
true for both languages: true for both languages:
</p>
<ol> <ol>
<li>You can point anywhere in the array, <em>or to the first element <li>You can point anywhere in the array, <em>or to the first element
past the end of the array</em>. A pointer that points to one past the end of the array</em>. A pointer that points to one
past the end of the array is guaranteed to be as unique as a past the end of the array is guaranteed to be as unique as a
pointer to somewhere inside the array, so that you can compare pointer to somewhere inside the array, so that you can compare
such pointers safely. such pointers safely.
</li>
<li>You can only dereference a pointer that points into an array. <li>You can only dereference a pointer that points into an array.
If your array pointer points outside the array -- even to just If your array pointer points outside the array -- even to just
one past the end -- and you dereference it, Bad Things happen. one past the end -- and you dereference it, Bad Things happen.
</li>
<li>Strictly speaking, simply pointing anywhere else invokes <li>Strictly speaking, simply pointing anywhere else invokes
undefined behavior. Most programs won't puke until such a undefined behavior. Most programs won't puke until such a
pointer is actually dereferenced, but the standards leave that pointer is actually dereferenced, but the standards leave that
up to the platform. up to the platform.
</li>
</ol> </ol>
The reason this past-the-end addressing was allowed is to make it <p>The reason this past-the-end addressing was allowed is to make it
easy to write a loop to go over an entire array, e.g., easy to write a loop to go over an entire array, e.g.,
while (*d++ = *s++);. while (*d++ = *s++);.
</p> </p>
<p>So, when you think of two pointers delimiting an array, don't think <p>So, when you think of two pointers delimiting an array, don't think
of them as indexing 0 through n-1. Think of them as <em>boundary of them as indexing 0 through n-1. Think of them as <em>boundary
markers</em>: markers</em>:
</p>
<pre> <pre>
beginning end beginning end
...@@ -122,7 +126,7 @@ ...@@ -122,7 +126,7 @@
beginning end beginning end
</pre> </pre>
See? Everything between the boundary markers is part of the array. <p>See? Everything between the boundary markers is part of the array.
Simple. Simple.
</p> </p>
<p>Now think back to your junior-high school algebra course, when you <p>Now think back to your junior-high school algebra course, when you
...@@ -171,7 +175,7 @@ ...@@ -171,7 +175,7 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<p class="fineprint"><em> <p class="fineprint"><em>
See <a href="../17_intro/license.html">license.html</a> for copying conditions. See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to Comments and suggestions are welcome, and may be sent to
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)"> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
<meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL"> <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL" />
<meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 25."> <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 25." />
<meta name="GENERATOR" content="vi and eight fingers"> <meta name="GENERATOR" content="vi and eight fingers" />
<title>libstdc++-v3 HOWTO: Chapter 25</title> <title>libstdc++-v3 HOWTO: Chapter 25</title>
<link rel="StyleSheet" href="../lib3styles.css"> <link rel="StyleSheet" href="../lib3styles.css" />
</head> </head>
<body> <body>
...@@ -19,14 +18,14 @@ ...@@ -19,14 +18,14 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<h1>Contents</h1> <h1>Contents</h1>
<ul> <ul>
<li><a href="#1">Prerequisites</a> <li><a href="#1">Prerequisites</a></li>
<li><a href="#2">Special <code>swap</code>s</a> <li><a href="#2">Special <code>swap</code>s</a></li>
</ul> </ul>
<hr> <hr />
<!-- ####################################################### --> <!-- ####################################################### -->
...@@ -34,16 +33,18 @@ ...@@ -34,16 +33,18 @@
<p>The neatest accomplishment of the algorithms chapter is that all the <p>The neatest accomplishment of the algorithms chapter is that all the
work is done via iterators, not containers directly. This means two work is done via iterators, not containers directly. This means two
important things: important things:
</p>
<ol> <ol>
<li>Anything that behaves like an iterator can be used in one of <li>Anything that behaves like an iterator can be used in one of
these algorithms. Raw pointers make great candidates, thus these algorithms. Raw pointers make great candidates, thus
built-in arrays are fine containers, as well as your own iterators. built-in arrays are fine containers, as well as your own iterators.
</li>
<li>The algorithms do not (and cannot) affect the container as a <li>The algorithms do not (and cannot) affect the container as a
whole; only the things between the two iterator endpoints. If whole; only the things between the two iterator endpoints. If
you pass a range of iterators only enclosing the middle third of you pass a range of iterators only enclosing the middle third of
a container, then anything outside that range is inviolate. a container, then anything outside that range is inviolate.
</li>
</ol> </ol>
</p>
<p>Even strings can be fed through the algorithms here, although the <p>Even strings can be fed through the algorithms here, although the
string class has specialized versions of many of these functions (for string class has specialized versions of many of these functions (for
example, <code>string::find()</code>). Most of the examples on this example, <code>string::find()</code>). Most of the examples on this
...@@ -67,7 +68,7 @@ ...@@ -67,7 +68,7 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="2">Special <code>swap</code>s</a></h2> <h2><a name="2">Special <code>swap</code>s</a></h2>
<p>If you call <code> std::swap(x,y); </code> where x and y are standard <p>If you call <code> std::swap(x,y); </code> where x and y are standard
containers, then the call will automatically be replaced by a call to containers, then the call will automatically be replaced by a call to
...@@ -90,7 +91,7 @@ ...@@ -90,7 +91,7 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<p class="fineprint"><em> <p class="fineprint"><em>
See <a href="../17_intro/license.html">license.html</a> for copying conditions. See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to Comments and suggestions are welcome, and may be sent to
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)"> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
<meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL"> <meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL" />
<meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 26."> <meta name="DESCRIPTION" content="HOWTO for the libstdc++ chapter 26." />
<meta name="GENERATOR" content="vi and eight fingers"> <meta name="GENERATOR" content="vi and eight fingers" />
<title>libstdc++-v3 HOWTO: Chapter 26</title> <title>libstdc++-v3 HOWTO: Chapter 26</title>
<link rel="StyleSheet" href="../lib3styles.css"> <link rel="StyleSheet" href="../lib3styles.css" />
</head> </head>
<body> <body>
...@@ -15,29 +14,32 @@ ...@@ -15,29 +14,32 @@
<p>Chapter 26 deals with building block abstractions to aid in <p>Chapter 26 deals with building block abstractions to aid in
numerical computing: numerical computing:
<ul> </p>
<ul>
<li>Template data structures such as <code>valarray&lt;&gt;</code> <li>Template data structures such as <code>valarray&lt;&gt;</code>
and <code>complex&lt;&gt;</code>. and <code>complex&lt;&gt;</code>.
</li>
<li>Template numerical functions such as <code>accumulate</code>, <li>Template numerical functions such as <code>accumulate</code>,
<code>inner_product</code>, <code>partial_sum</code>, and <code>inner_product</code>, <code>partial_sum</code>, and
<code>adjacent_difference</code>. <code>adjacent_difference</code>.
</ul> </li>
All of the Standard C math functions are of course included in C++, </ul>
<p>All of the Standard C math functions are of course included in C++,
and overloaded versions for <code>long</code>, <code>float</code>, and and overloaded versions for <code>long</code>, <code>float</code>, and
<code>long double</code> have been added for all of them. <code>long double</code> have been added for all of them.
</p> </p>
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<h1>Contents</h1> <h1>Contents</h1>
<ul> <ul>
<li><a href="#1">Complex Number Processing</a> <li><a href="#1">Complex Number Processing</a></li>
<li><a href="#2">Array Processing</a> <li><a href="#2">Array Processing</a></li>
<li><a href="#3">Numerical Functions</a> <li><a href="#3">Numerical Functions</a></li>
<li><a href="#4">C99</a> <li><a href="#4">C99</a></li>
</ul> </ul>
<hr> <hr />
<!-- ####################################################### --> <!-- ####################################################### -->
...@@ -62,7 +64,7 @@ ...@@ -62,7 +64,7 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="2">Array Processing</a></h2> <h2><a name="2">Array Processing</a></h2>
<p>One of the major reasons why FORTRAN can chew through numbers so well <p>One of the major reasons why FORTRAN can chew through numbers so well
is that it is defined to be free of pointer aliasing, an assumption is that it is defined to be free of pointer aliasing, an assumption
...@@ -87,21 +89,22 @@ ...@@ -87,21 +89,22 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="3">Numerical Functions</a></h2> <h2><a name="3">Numerical Functions</a></h2>
<p>There are four generalized functions in the &lt;numeric&gt; header <p>There are four generalized functions in the &lt;numeric&gt; header
that follow the same conventions as those in &lt;algorithm&gt;. Each that follow the same conventions as those in &lt;algorithm&gt;. Each
of them is overloaded: one signature for common default operations, of them is overloaded: one signature for common default operations,
and a second for fully general operations. Their names are and a second for fully general operations. Their names are
self-explanatory to anyone who works with numerics on a regular basis: self-explanatory to anyone who works with numerics on a regular basis:
</p>
<ul> <ul>
<li><code>accumulate</code> <li><code>accumulate</code></li>
<li><code>inner_product</code> <li><code>inner_product</code></li>
<li><code>partial_sum</code> <li><code>partial_sum</code></li>
<li><code>adjacent_difference</code> <li><code>adjacent_difference</code></li>
</ul> </ul>
</p>
<p>Here is a simple example of the two forms of <code>accumulate</code>. <p>Here is a simple example of the two forms of <code>accumulate</code>.
</p>
<pre> <pre>
int ar[50]; int ar[50];
int someval = somefunction(); int someval = somefunction();
...@@ -112,7 +115,7 @@ ...@@ -112,7 +115,7 @@
int sum_stuff = std::accumulate(ar,ar+50,someval); int sum_stuff = std::accumulate(ar,ar+50,someval);
int product = std::accumulate(ar,ar+50,1,std::multiplies&lt;int&gt;()); int product = std::accumulate(ar,ar+50,1,std::multiplies&lt;int&gt;());
</pre> </pre>
The first call adds all the members of the array, using zero as an <p>The first call adds all the members of the array, using zero as an
initial value for <code>sum</code>. The second does the same, but uses initial value for <code>sum</code>. The second does the same, but uses
<code>someval</code> as the starting value (thus, <code>sum_stuff == sum + <code>someval</code> as the starting value (thus, <code>sum_stuff == sum +
someval</code>). The final call uses the second of the two signatures, someval</code>). The final call uses the second of the two signatures,
...@@ -125,7 +128,7 @@ ...@@ -125,7 +128,7 @@
<a href="../faq/index.html">to the FAQ</a>. <a href="../faq/index.html">to the FAQ</a>.
</p> </p>
<hr> <hr />
<h2><a name="4">C99</a></h2> <h2><a name="4">C99</a></h2>
<p>In addition to the other topics on this page, we'll note here some <p>In addition to the other topics on this page, we'll note here some
of the C99 features that appear in libstdc++-v3. of the C99 features that appear in libstdc++-v3.
...@@ -151,7 +154,7 @@ ...@@ -151,7 +154,7 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<p class="fineprint"><em> <p class="fineprint"><em>
See <a href="../17_intro/license.html">license.html</a> for copying conditions. See <a href="../17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to Comments and suggestions are welcome, and may be sent to
......
...@@ -13,7 +13,7 @@ documentation.html: $(wildcard */howto.html) ...@@ -13,7 +13,7 @@ documentation.html: $(wildcard */howto.html)
sed -n '1,/beginlist/p' $@ > tmp.top sed -n '1,/beginlist/p' $@ > tmp.top
sed -n '/endlist/,$$p' $@ > tmp.bottom sed -n '/endlist/,$$p' $@ > tmp.bottom
echo ' <ul>' > tmp.middle echo ' <ul>' > tmp.middle
for i in [[:digit:]]*/howto.html; do \ for i in [0-9]*/howto.html; do \
title=`grep 'h1 ' $$i |\ title=`grep 'h1 ' $$i |\
sed 's=.*\(Chapter [[:digit:]]*\):[[:space:]]*\(.*\)</a>.*=\2 (\1)='` ;\ sed 's=.*\(Chapter [[:digit:]]*\):[[:space:]]*\(.*\)</a>.*=\2 (\1)='` ;\
awk -v file=$$i -v "title=$$title" -f makedoc.awk $$i >> tmp.middle ;\ awk -v file=$$i -v "title=$$title" -f makedoc.awk $$i >> tmp.middle ;\
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html> <html>
<head> <head>
<meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)"> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
<meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++"> <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++" />
<meta name="DESCRIPTION" content="Configuration options for libstdc++-v3."> <meta name="DESCRIPTION" content="Configuration options for libstdc++-v3." />
<meta name="GENERATOR" content="vi and eight fingers"> <meta name="GENERATOR" content="vi and eight fingers" />
<title>libstdc++-v3 configure options</title> <title>libstdc++-v3 configure options</title>
<link rel="StyleSheet" href="lib3styles.css"> <link rel="StyleSheet" href="lib3styles.css" />
</head> </head>
<body> <body>
...@@ -19,10 +18,10 @@ options</a></h1> ...@@ -19,10 +18,10 @@ options</a></h1>
</p> </p>
<p>To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>. <p>To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
</p>
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<p>Here are some of the non-obvious options to libstdc++'s configure. <p>Here are some of the non-obvious options to libstdc++'s configure.
Keep in mind that Keep in mind that
<!-- This SECnn should be the "Choosing Package Options" section. --> <!-- This SECnn should be the "Choosing Package Options" section. -->
...@@ -37,15 +36,16 @@ options</a></h1> ...@@ -37,15 +36,16 @@ options</a></h1>
</p> </p>
<dl> <dl>
<dt><code>--enable-multilib </code>[default] <dt><code>--enable-multilib </code>[default]</dt>
<dd><p>This is part of the generic multilib support for building cross <dd><p>This is part of the generic multilib support for building cross
compilers. As such, targets like &quot;powerpc-elf&quot; will have compilers. As such, targets like &quot;powerpc-elf&quot; will have
libstdc++ built many different ways: &quot;-msoft-float&quot; libstdc++ built many different ways: &quot;-msoft-float&quot;
and not, etc. A different libstdc++ will be built for each of and not, etc. A different libstdc++ will be built for each of
the different multilib versions. This option is on by default. the different multilib versions. This option is on by default.
</p> </p>
</dd>
<dt><code>--enable-debug </code> <dt><code>--enable-debug </code></dt>
<dd><p>The configure script will automatically detect the highest <dd><p>The configure script will automatically detect the highest
level of optimization that the compiler in use can use. level of optimization that the compiler in use can use.
This --enable flag will disable all optimizations and instruct This --enable flag will disable all optimizations and instruct
...@@ -55,13 +55,15 @@ options</a></h1> ...@@ -55,13 +55,15 @@ options</a></h1>
configuration difference: configuration difference:
<code>make CXXFLAGS='-g -O0' all</code> <code>make CXXFLAGS='-g -O0' all</code>
</p> </p>
</dd>
<dt><code>--enable-cstdio </code> <dt><code>--enable-cstdio </code></dt>
<dd><p>This is an abbreviated form of <code>'--enable-cstdio=stdio'</code> <dd><p>This is an abbreviated form of <code>'--enable-cstdio=stdio'</code>
(described next). (described next).
</p> </p>
</dd>
<dt><code>--enable-cstdio=LIB </code> <dt><code>--enable-cstdio=LIB </code></dt>
<dd><p>Select a target-specific I/O package. As of libstdc++-v3 <dd><p>Select a target-specific I/O package. As of libstdc++-v3
snapshot 3.0.96, the choices are 'libio' to specify the GNU snapshot 3.0.96, the choices are 'libio' to specify the GNU
I/O package (from I/O package (from
...@@ -70,32 +72,36 @@ options</a></h1> ...@@ -70,32 +72,36 @@ options</a></h1>
abstraction. The default is 'stdio'. A longer explanation abstraction. The default is 'stdio'. A longer explanation
is <a href="explanations.html#cstdio">here</a>. is <a href="explanations.html#cstdio">here</a>.
</p> </p>
</dd>
<dt><code>--enable-sjlj-exceptions </code> <dt><code>--enable-sjlj-exceptions </code></dt>
<dd><p>Forces old, set-jump/long-jump exception handling model. If <dd><p>Forces old, set-jump/long-jump exception handling model. If
at all possible, the new, frame unwinding exception handling routines at all possible, the new, frame unwinding exception handling routines
should be used instead, as they significantly reduce both runtime should be used instead, as they significantly reduce both runtime
memory usage and executable size. memory usage and executable size.
</p> </p>
</dd>
<dt><code>--enable-clocale </code> <dt><code>--enable-clocale </code></dt>
<dd><p>This is an abbreviated form of <code>'--enable-clocale=generic'</code> <dd><p>This is an abbreviated form of <code>'--enable-clocale=generic'</code>
(described next). (described next).
</p> </p>
</dd>
<dt><code>--enable-clocale=MODEL </code> <dt><code>--enable-clocale=MODEL </code></dt>
<dd><p>Select a target-specific underlying locale package. The <dd><p>Select a target-specific underlying locale package. The
choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix
(IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets, (IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets,
'gnu' to specify a model based on functionality from the GNU C 'gnu' to specify a model based on functionality from the GNU C
library (langinfo/iconv/gettext) (from <A library (langinfo/iconv/gettext) (from <a
href="http://sources.redhat.com/glibc/">glibc</a>, the GNU C href="http://sources.redhat.com/glibc/">glibc</a>, the GNU C
library), or 'generic' to use a generic &quot;C&quot; library), or 'generic' to use a generic &quot;C&quot;
abstraction which consists of &quot;C&quot; locale info. The abstraction which consists of &quot;C&quot; locale info. The
default is 'generic'. default is 'generic'.
</p> </p>
</dd>
<dt><code>--enable-c99 </code> <dt><code>--enable-c99 </code></dt>
<dd><p>The &quot;long long&quot; type was introduced in C99, along <dd><p>The &quot;long long&quot; type was introduced in C99, along
with many other functions for wide characters, and math with many other functions for wide characters, and math
classification macros, etc. If enabled, all C99 functions not classification macros, etc. If enabled, all C99 functions not
...@@ -108,8 +114,9 @@ options</a></h1> ...@@ -108,8 +114,9 @@ options</a></h1>
configure probes find all the necessary functions and bits configure probes find all the necessary functions and bits
necessary. necessary.
</p> </p>
</dd>
<dt><code>--enable-long-long </code> <dt><code>--enable-long-long </code></dt>
<dd><p>The &quot;long long&quot; type was introduced in C99. It is <dd><p>The &quot;long long&quot; type was introduced in C99. It is
provided as a GNU extension to C++98 in g++. This flag builds provided as a GNU extension to C++98 in g++. This flag builds
support for &quot;long long&quot; into the library (specialized support for &quot;long long&quot; into the library (specialized
...@@ -121,26 +128,30 @@ options</a></h1> ...@@ -121,26 +128,30 @@ options</a></h1>
the flag is -D_ISOC99_SOURCE, which is added automatically via the flag is -D_ISOC99_SOURCE, which is added automatically via
CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE). CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE).
</p> </p>
</dd>
<dt><code>--enable-cheaders=OPTION </code> <dt><code>--enable-cheaders=OPTION </code></dt>
<dd><p>This allows the user to define what kind of C headers are <dd><p>This allows the user to define what kind of C headers are
used. Options are: c, c_std, and c_shadow. These correspond used. Options are: c, c_std, and c_shadow. These correspond
to the source directory's include/c, include/c_std, and to the source directory's include/c, include/c_std, and
include/c_shadow directories. The default is c_std. include/c_shadow directories. The default is c_std.
</p> </p>
</dd>
<dt><code>--enable-threads </code> <dt><code>--enable-threads </code></dt>
<dd><p>This is an abbreviated form of <code>'--enable-threads=yes'</code> <dd><p>This is an abbreviated form of <code>'--enable-threads=yes'</code>
(described next). (described next).
</p> </p>
</dd>
<dt><code>--enable-threads=LIB </code> <dt><code>--enable-threads=LIB </code></dt>
<dd><p>Select a threading library. A full description is given in the <dd><p>Select a threading library. A full description is given in the
general <a href="http://gcc.gnu.org/install/configure.html">compiler general <a href="http://gcc.gnu.org/install/configure.html">compiler
configuration instructions</a>. configuration instructions</a>.
</p> </p>
</dd>
<dt><code>--enable-version-specific-runtime-libs </code> <dt><code>--enable-version-specific-runtime-libs </code></dt>
<dd><p>Specify that run-time libraries should be installed in the <dd><p>Specify that run-time libraries should be installed in the
compiler-specific subdirectory (i.e., compiler-specific subdirectory (i.e.,
<code>${libdir}/gcc-lib/${target_alias}/${gcc_version}</code>) <code>${libdir}/gcc-lib/${target_alias}/${gcc_version}</code>)
...@@ -151,17 +162,18 @@ options</a></h1> ...@@ -151,17 +162,18 @@ options</a></h1>
unless you also specify unless you also specify
<code>--with-gxx-include-dir=<em>dirname</em></code> during configuration. <code>--with-gxx-include-dir=<em>dirname</em></code> during configuration.
</p> </p>
</dd>
<dt><code>--with-gxx-include-dir=&lt;include-files dir&gt;</code> <dt><code>--with-gxx-include-dir=&lt;include-files dir&gt;</code></dt>
<dd><p>Adds support for named libstdc++ include directory. For instance, <dd><p>Adds support for named libstdc++ include directory. For instance,
the following puts all the libstdc++ headers into a directory the following puts all the libstdc++ headers into a directory
called &quot;2.97-20001008&quot; instead of the usual called &quot;2.97-20001008&quot; instead of the usual
&quot;g++-v3&quot;. &quot;g++-v3&quot;.
</p> </p>
<pre> <pre>
--with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/2.97-20001008</pre> --with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/2.97-20001008</pre> </dd>
<dt><code>--enable-cxx-flags=FLAGS</code> <dt><code>--enable-cxx-flags=FLAGS</code></dt>
<dd><p>With this option, you can pass a string of -f (functionality) <dd><p>With this option, you can pass a string of -f (functionality)
flags to the compiler to use when building libstdc++. FLAGS flags to the compiler to use when building libstdc++. FLAGS
is a quoted string of options, like is a quoted string of options, like
...@@ -188,8 +200,9 @@ options</a></h1> ...@@ -188,8 +200,9 @@ options</a></h1>
<p>and opposite forms (-fno-) of the same. Tell us (the libstdc++ <p>and opposite forms (-fno-) of the same. Tell us (the libstdc++
mailing list) if you discover more! mailing list) if you discover more!
</p> </p>
</dd>
<dt><code>--enable-c-mbchar </code>[default] <dt><code>--enable-c-mbchar </code>[default]</dt>
<dd><p>Certain template specializations are required for wide <dd><p>Certain template specializations are required for wide
character conversion support. This is tricky and currently character conversion support. This is tricky and currently
changing rapidly, and can cause problems on new platforms. changing rapidly, and can cause problems on new platforms.
...@@ -197,16 +210,18 @@ options</a></h1> ...@@ -197,16 +210,18 @@ options</a></h1>
porting steps, but builds only a subset of what is required by porting steps, but builds only a subset of what is required by
ISO. By default, this option is on. ISO. By default, this option is on.
</p> </p>
</dd>
<dt><code>--enable-concept-checks </code> <dt><code>--enable-concept-checks </code></dt>
<dd><p>This turns on additional compile-time checks for instantiated <dd><p>This turns on additional compile-time checks for instantiated
library templates, in the form of specialized templates, library templates, in the form of specialized templates,
<a href="19_diagnostics/howto.html#3">described here</a>. They <a href="19_diagnostics/howto.html#3">described here</a>. They
can help users discover when they break the rules of the STL, before can help users discover when they break the rules of the STL, before
their programs run. their programs run.
</p> </p>
</dd>
<dt><code>--enable-symvers[=style] </code> <dt><code>--enable-symvers[=style] </code></dt>
<dd><p>In 3.1, tries to turn on symbol versioning in the shared library (if a <dd><p>In 3.1, tries to turn on symbol versioning in the shared library (if a
shared library has been requested). The only 'style' currently shared library has been requested). The only 'style' currently
supported is 'gnu' which requires that a recent version of the GNU supported is 'gnu' which requires that a recent version of the GNU
...@@ -214,6 +229,7 @@ options</a></h1> ...@@ -214,6 +229,7 @@ options</a></h1>
try to guess if the 'gnu' style can be used, and if so, will turn it try to guess if the 'gnu' style can be used, and if so, will turn it
on. Hopefully people will volunteer to do other 'style' options. on. Hopefully people will volunteer to do other 'style' options.
</p> </p>
</dd>
</dl> </dl>
<p>Return <a href="#top">to the top of the page</a> or <p>Return <a href="#top">to the top of the page</a> or
<a href="http://gcc.gnu.org/libstdc++/">to the libstdc++ homepage</a>. <a href="http://gcc.gnu.org/libstdc++/">to the libstdc++ homepage</a>.
...@@ -222,7 +238,7 @@ options</a></h1> ...@@ -222,7 +238,7 @@ options</a></h1>
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<p class="fineprint"><em> <p class="fineprint"><em>
See <a href="17_intro/license.html">license.html</a> for copying conditions. See <a href="17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to Comments and suggestions are welcome, and may be sent to
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <html>
<head> <head>
<meta name="KEYWORDS" <meta name="KEYWORDS"
content="libstdc++, homepage, home, C++, library, c++, std, g++, ABI, STL"> content="libstdc++, homepage, home, C++, library, c++, std, g++, ABI, STL" />
<title>GNU C++ Standard Library</title> <title>GNU C++ Standard Library</title>
<link rel="StyleSheet" href="lib3styles.css"> <link rel="StyleSheet" href="lib3styles.css" />
</head> </head>
<body> <body>
...@@ -15,40 +14,40 @@ ...@@ -15,40 +14,40 @@
automatically-generated source documentation, available separately. automatically-generated source documentation, available separately.
</p> </p>
<hr /> <hr />
<br> <br />
<h2><a name="1">Introduction</a></h2> <h2><a name="1">Introduction</a></h2>
<p>This is a short list of text files pertaining to this implementation of <p>This is a short list of text files pertaining to this implementation of
ISO 14882. A brief description may follow the name of the file. ISO 14882. A brief description may follow the name of the file.
</p>
<ul> <ul>
<li><a href="17_intro/COPYING">License</a> <li><a href="17_intro/COPYING">License</a>
- GPL v2 license terms - GPL v2 license terms</li>
<li><a href="abi.txt">ABI Policy and Guidelines</a> <li><a href="abi.txt">ABI Policy and Guidelines</a></li>
<li><a href="17_intro/BUGS">BUGS</a> <li><a href="17_intro/BUGS">BUGS</a></li>
<li><a href="17_intro/PROBLEMS">PROBLEMS</a> <li><a href="17_intro/PROBLEMS">PROBLEMS</a>
- target-specific known issues - target-specific known issues</li>
<!-- Linking to "../README" doesn't work; we are at the top level <!-- Linking to "../README" doesn't work; we are at the top level
of the web pages. Punt. --> of the web pages. Punt. -->
<li>README - directory structure <li>README - directory structure</li>
<li><a href="17_intro/RELEASE-NOTES">RELEASE-NOTES</a> <li><a href="17_intro/RELEASE-NOTES">RELEASE-NOTES</a>
- latest version info, recent changes and news - latest version info, recent changes and news</li>
<li><a href="17_intro/TODO">TODO</a> <li><a href="17_intro/TODO">TODO</a>
- tasks yet undone - tasks yet undone</li>
</ul> </ul>
<hr /> <hr />
<br> <br />
<h2><a name="2">Configuring, Building, Installing</a></h2> <h2><a name="2">Configuring, Building, Installing</a></h2>
<ul> <ul>
<li><a href="configopts.html">Configure options</a> <li><a href="configopts.html">Configure options</a></li>
<li><a href="install.html">Getting started: configure, build, install</a> <li><a href="install.html">Getting started: configure, build, install</a>
</ul> </li>
</ul>
<hr /> <hr />
<br> <br />
<h2><a name="4">Source-Level Documentation</a></h2> <h2><a name="4">Source-Level Documentation</a></h2>
<p>The library sources have been specially formatted so that with the <p>The library sources have been specially formatted so that with the
proper invocation of another tool (Doxygen), a set of HTML pages proper invocation of another tool (Doxygen), a set of HTML pages
...@@ -58,13 +57,16 @@ ...@@ -58,13 +57,16 @@
the library classes, finding out what is in a particular include the library classes, finding out what is in a particular include
file, looking at inheritance diagrams, etc. file, looking at inheritance diagrams, etc.
</p> </p>
<p>The Source-Level documentation can be viewed online: <p>The Source-Level documentation can be viewed online:</p>
<ul> <ul>
<li><a href="libstdc++-html-USERS-3.1/index.html">for the 3.1 release</a> <li><a href="libstdc++-html-USERS-3.1/index.html">for the 3.1 release</a>
</li>
<li><a href="libstdc++-html-USERS-3.2/index.html">for the 3.2 release</a> <li><a href="libstdc++-html-USERS-3.2/index.html">for the 3.2 release</a>
</li>
<li><a href="latest-doxygen/index.html">&quot;the latest collection&quot;</a> <li><a href="latest-doxygen/index.html">&quot;the latest collection&quot;</a>
(for the snapshot or later; see the date on the first page) (for the snapshot or later; see the date on the first page)
</ul> </li>
</ul>
<p>This generated HTML collection, as above, is also available for download in <p>This generated HTML collection, as above, is also available for download in
the libstdc++ snapshots directory at the libstdc++ snapshots directory at
<code>&lt;URL:ftp://gcc.gnu.org/pub/gcc/libstdc++/doxygen/&gt;</code>. <code>&lt;URL:ftp://gcc.gnu.org/pub/gcc/libstdc++/doxygen/&gt;</code>.
...@@ -81,7 +83,7 @@ ...@@ -81,7 +83,7 @@
<hr /> <hr />
<br> <br />
<h2><a name="3">Chapter-Specific Documentation</a></h2> <h2><a name="3">Chapter-Specific Documentation</a></h2>
<p>Information, extensions, notes and advice on specific implementation <p>Information, extensions, notes and advice on specific implementation
capabilites and/or liabilities broken down into chapter names based on the capabilites and/or liabilities broken down into chapter names based on the
...@@ -95,7 +97,7 @@ ...@@ -95,7 +97,7 @@
--> -->
<!-- beginlist --> <!-- beginlist -->
<ul> <ul>
<li>Library Introduction (Chapter 17)</li> <li>Library Introduction (Chapter 17)
<ul> <ul>
<li><a href="17_intro/howto.html#2">The Standard C++ header files</a></li> <li><a href="17_intro/howto.html#2">The Standard C++ header files</a></li>
<li><a href="17_intro/howto.html#3">The Standard C++ library and multithreading</a></li> <li><a href="17_intro/howto.html#3">The Standard C++ library and multithreading</a></li>
...@@ -104,8 +106,9 @@ ...@@ -104,8 +106,9 @@
<li><a href="17_intro/howto.html#5">Behavior specific to libstdc++-v3</a></li> <li><a href="17_intro/howto.html#5">Behavior specific to libstdc++-v3</a></li>
<li><a href="17_intro/howto.html#6">Preprocessor macros controlling the library</a></li> <li><a href="17_intro/howto.html#6">Preprocessor macros controlling the library</a></li>
</ul> </ul>
</li>
<li>Library Support (Chapter 18)</li> <li>Library Support (Chapter 18)
<ul> <ul>
<li><a href="18_support/howto.html#1">Types</a></li> <li><a href="18_support/howto.html#1">Types</a></li>
<li><a href="18_support/howto.html#2">Implementation properties</a></li> <li><a href="18_support/howto.html#2">Implementation properties</a></li>
...@@ -113,24 +116,27 @@ ...@@ -113,24 +116,27 @@
<li><a href="18_support/howto.html#4">Dynamic memory management</a></li> <li><a href="18_support/howto.html#4">Dynamic memory management</a></li>
<li><a href="18_support/howto.html#5">RTTI, the ABI, and demangling</a></li> <li><a href="18_support/howto.html#5">RTTI, the ABI, and demangling</a></li>
</ul> </ul>
</li>
<li>Diagnostics (Chapter 19)</li> <li>Diagnostics (Chapter 19)
<ul> <ul>
<li><a href="19_diagnostics/howto.html#1">Adding data to exceptions</a></li> <li><a href="19_diagnostics/howto.html#1">Adding data to exceptions</a></li>
<li><a href="19_diagnostics/howto.html#2">Exception class hierarchy diagram</a></li> <li><a href="19_diagnostics/howto.html#2">Exception class hierarchy diagram</a></li>
<li><a href="19_diagnostics/howto.html#3">Concept checkers -- <strong>new and improved!</strong></a></li> <li><a href="19_diagnostics/howto.html#3">Concept checkers -- <strong>new and improved!</strong></a></li>
<li><a href="19_diagnostics/howto.html#4">Verbose <code>terminate</code></a></li> <li><a href="19_diagnostics/howto.html#4">Verbose <code>terminate</code></a></li>
</ul> </ul>
</li>
<li>General Utilities (Chapter 20)</li> <li>General Utilities (Chapter 20)
<ul> <ul>
<li><a href="20_util/howto.html#1"><code>auto_ptr</code> is not omnipotent</a></li> <li><a href="20_util/howto.html#1"><code>auto_ptr</code> is not omnipotent</a></li>
<li><a href="20_util/howto.html#2"><code>auto_ptr</code> inside container classes</a></li> <li><a href="20_util/howto.html#2"><code>auto_ptr</code> inside container classes</a></li>
<li><a href="20_util/howto.html#3">Functors</a></li> <li><a href="20_util/howto.html#3">Functors</a></li>
<li><a href="20_util/howto.html#4">Pairs</a></li> <li><a href="20_util/howto.html#4">Pairs</a></li>
</ul> </ul>
</li>
<li>Strings (Chapter 21)</li> <li>Strings (Chapter 21)
<ul> <ul>
<li><a href="21_strings/howto.html#1">MFC's CString</a></li> <li><a href="21_strings/howto.html#1">MFC's CString</a></li>
<li><a href="21_strings/howto.html#2">A case-insensitive string class</a></li> <li><a href="21_strings/howto.html#2">A case-insensitive string class</a></li>
...@@ -138,19 +144,21 @@ ...@@ -138,19 +144,21 @@
<li><a href="21_strings/howto.html#4">Simple transformations</a></li> <li><a href="21_strings/howto.html#4">Simple transformations</a></li>
<li><a href="21_strings/howto.html#5">Making strings of arbitrary character types</a></li> <li><a href="21_strings/howto.html#5">Making strings of arbitrary character types</a></li>
</ul> </ul>
</li>
<li>Localization (Chapter 22)</li> <li>Localization (Chapter 22)
<ul> <ul>
<li><a href="22_locale/howto.html#1">class locale</a></li> <li><a href="22_locale/howto.html#1">class locale</a></li>
<li><a href="22_locale/howto.html#2">class codecvt</a></li> <li><a href="22_locale/howto.html#2">class codecvt</a></li>
<li><a href="22_locale/howto.html#3">class ctype</a></li> <li><a href="22_locale/howto.html#3">class ctype</a></li>
<li><a href="22_locale/howto.html#4">class messages</a></li> <li><a href="22_locale/howto.html#4">class messages</a></li>
<li><a href="22_locale/howto.html#5">Bjarne Stroustrup on Locales</a></li> <li><a href="22_locale/howto.html#5">Bjarne Stroustrup on Locales</a></li>
<li><a href="22_locale/howto.html#6">Nathan Myers on Locales </a></li> <li><a href="22_locale/howto.html#6">Nathan Myers on Locales</a></li>
<li><a href="22_locale/howto.html#7">Correct Transformations</a></li> <li><a href="22_locale/howto.html#7">Correct Transformations</a></li>
</ul> </ul>
</li>
<li>Containers (Chapter 23)</li> <li>Containers (Chapter 23)
<ul> <ul>
<li><a href="23_containers/howto.html#1">Making code unaware of the container/array difference</a></li> <li><a href="23_containers/howto.html#1">Making code unaware of the container/array difference</a></li>
<li><a href="23_containers/howto.html#2">Variable-sized bitmasks</a></li> <li><a href="23_containers/howto.html#2">Variable-sized bitmasks</a></li>
...@@ -160,28 +168,32 @@ ...@@ -160,28 +168,32 @@
<li><a href="23_containers/howto.html#6"><code>std::list::size()</code> is O(n)!</a></li> <li><a href="23_containers/howto.html#6"><code>std::list::size()</code> is O(n)!</a></li>
<li><a href="23_containers/howto.html#7">Space overhead management for vectors</a></li> <li><a href="23_containers/howto.html#7">Space overhead management for vectors</a></li>
</ul> </ul>
</li>
<li>Iterators (Chapter 24)</li> <li>Iterators (Chapter 24)
<ul> <ul>
<li><a href="24_iterators/howto.html#1">They ain't pointers!</a></li> <li><a href="24_iterators/howto.html#1">They ain't pointers!</a></li>
<li><a href="24_iterators/howto.html#2">It ends <em>where?</em></a></li> <li><a href="24_iterators/howto.html#2">It ends <em>where?</em></a></li>
</ul> </ul>
</li>
<li>Algorithms (Chapter 25)</li> <li>Algorithms (Chapter 25)
<ul> <ul>
<li><a href="25_algorithms/howto.html#1">Prerequisites</a></li> <li><a href="25_algorithms/howto.html#1">Prerequisites</a></li>
<li><a href="25_algorithms/howto.html#2">Special <code>swap</code>s</a></li> <li><a href="25_algorithms/howto.html#2">Special <code>swap</code>s</a></li>
</ul> </ul>
</li>
<li>Numerics (Chapter 26)</li> <li>Numerics (Chapter 26)
<ul> <ul>
<li><a href="26_numerics/howto.html#1">Complex Number Processing</a></li> <li><a href="26_numerics/howto.html#1">Complex Number Processing</a></li>
<li><a href="26_numerics/howto.html#2">Array Processing</a></li> <li><a href="26_numerics/howto.html#2">Array Processing</a></li>
<li><a href="26_numerics/howto.html#3">Numerical Functions</a></li> <li><a href="26_numerics/howto.html#3">Numerical Functions</a></li>
<li><a href="26_numerics/howto.html#4">C99</a></li> <li><a href="26_numerics/howto.html#4">C99</a></li>
</ul> </ul>
</li>
<li>Input/Output (Chapter 27)</li> <li>Input/Output (Chapter 27)
<ul> <ul>
<li><a href="27_io/howto.html#1">Copying a file</a></li> <li><a href="27_io/howto.html#1">Copying a file</a></li>
<li><a href="27_io/howto.html#2">The buffering is screwing up my program!</a></li> <li><a href="27_io/howto.html#2">The buffering is screwing up my program!</a></li>
...@@ -192,8 +204,9 @@ ...@@ -192,8 +204,9 @@
<li><a href="27_io/howto.html#8">Pathetic performance? Ditch C.</a></li> <li><a href="27_io/howto.html#8">Pathetic performance? Ditch C.</a></li>
<li><a href="27_io/howto.html#9">Threads and I/O</a></li> <li><a href="27_io/howto.html#9">Threads and I/O</a></li>
</ul> </ul>
</li>
<li>Extensions to the Standard Library</li> <li>Extensions to the Standard Library
<ul> <ul>
<li><a href="ext/howto.html#1">Ropes and trees and hashes, oh my!</a></li> <li><a href="ext/howto.html#1">Ropes and trees and hashes, oh my!</a></li>
<li><a href="ext/howto.html#2">Added members and types</a></li> <li><a href="ext/howto.html#2">Added members and types</a></li>
...@@ -202,27 +215,28 @@ ...@@ -202,27 +215,28 @@
<li><a href="ext/howto.html#4">Compile-time checks</a></li> <li><a href="ext/howto.html#4">Compile-time checks</a></li>
<li><a href="ext/howto.html#5">LWG Issues</a></li> <li><a href="ext/howto.html#5">LWG Issues</a></li>
</ul> </ul>
</li>
</ul> </ul>
<!-- endlist --> <!-- endlist -->
<hr /> <hr />
<br> <br />
<h2><a name="5">Contributor-Specific Information</a></h2> <h2><a name="5">Contributor-Specific Information</a></h2>
<ul> <ul>
<li><a href="17_intro/contribute.html">Contributor checklist</a> <li><a href="17_intro/contribute.html">Contributor checklist</a></li>
<li><a href="17_intro/libstdc++-assign.txt">Copyright assignment form for libstdc++-v3</a> <li><a href="17_intro/libstdc++-assign.txt">Copyright assignment form for libstdc++-v3</a></li>
<li><a href="17_intro/BADNAMES">BADNAMES</a> <li><a href="17_intro/BADNAMES">BADNAMES</a>
- names to avoid because of potential collisions - names to avoid because of potential collisions</li>
<li><a href="17_intro/C++STYLE">C++STYLE</a> <li><a href="17_intro/C++STYLE">C++STYLE</a>
- coding style by example - coding style by example</li>
<li><a href="17_intro/CHECKLIST">CHECKLIST</a> <li><a href="17_intro/CHECKLIST">CHECKLIST</a>
- a list of required features and their status. - a list of required features and their status.</li>
<li><a href="17_intro/DESIGN">DESIGN</a> <li><a href="17_intro/DESIGN">DESIGN</a>
- overview of the implementation plan - overview of the implementation plan</li>
<li><a href="17_intro/HEADER_POLICY">HEADER_POLICY</a> <li><a href="17_intro/HEADER_POLICY">HEADER_POLICY</a>
- header naming and sub-include structure - header naming and sub-include structure</li>
</ul> </ul>
<!-- ####################################################### --> <!-- ####################################################### -->
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html> <html>
<head> <head>
<meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)"> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
<meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++"> <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++" />
<meta name="DESCRIPTION" content="Explanatory notes about libstdc++-v3."> <meta name="DESCRIPTION" content="Explanatory notes about libstdc++-v3." />
<meta name="GENERATOR" content="vi and eight fingers"> <meta name="GENERATOR" content="vi and eight fingers" />
<title>Explanatory notes about libstdc++-v3 design</title> <title>Explanatory notes about libstdc++-v3 design</title>
<link rel="StyleSheet" href="lib3styles.css"> <link rel="StyleSheet" href="lib3styles.css" />
</head> </head>
<body> <body>
...@@ -19,11 +18,12 @@ design</a></h1> ...@@ -19,11 +18,12 @@ design</a></h1>
</p> </p>
<p>To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>. <p>To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
</p>
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<a name="cstdio"><h3>&quot;I/O packages&quot;, <code>--enable-cstdio</code></h3></a> <h3><a name="cstdio">&quot;I/O packages&quot;, <code>--enable-cstdio</code></a></h3>
<p>In addition to all the nifty things which C++ can do for I/O, its library <p>In addition to all the nifty things which C++ can do for I/O, its library
also includes all of the I/O capabilites of C. Making them work together also includes all of the I/O capabilites of C. Making them work together
can be a challenge, not only can be a challenge, not only
...@@ -61,8 +61,8 @@ design</a></h1> ...@@ -61,8 +61,8 @@ design</a></h1>
</p> </p>
<hr> <hr />
<a name="alloc"><h3>Internal Allocators</h3></a> <h3><a name="alloc">Internal Allocators</a></h3>
<p> <p>
</p> </p>
<p>Return <a href="#top">to the top of the page</a> or <p>Return <a href="#top">to the top of the page</a> or
...@@ -72,7 +72,7 @@ design</a></h1> ...@@ -72,7 +72,7 @@ design</a></h1>
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<p class="fineprint"><em> <p class="fineprint"><em>
See <a href="17_intro/license.html">license.html</a> for copying conditions. See <a href="17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to Comments and suggestions are welcome, and may be sent to
......
...@@ -106,8 +106,8 @@ ...@@ -106,8 +106,8 @@
The libstdc++ project is contributed to by several developers all over The libstdc++ project is contributed to by several developers all over
the world, in the same way as GCC or Linux. Benjamin Kosnik, Gabriel the world, in the same way as GCC or Linux. Benjamin Kosnik, Gabriel
Dos Reis, Phil Edwards, Ulrich Drepper, Loren James Rittle, and Dos Reis, Phil Edwards, Ulrich Drepper, Loren James Rittle, and Paolo
Paolo Carlini are the lead maintainers of the CVS archive. Carlini are the lead maintainers of the CVS archive.
Development and discussion is held on the libstdc++ mailing list. Development and discussion is held on the libstdc++ mailing list.
Subscribing to the list, or searching the list archives, is open to Subscribing to the list, or searching the list archives, is open to
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html> <html>
<head> <head>
<meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)"> <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
<meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++"> <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++" />
<meta name="DESCRIPTION" content="README for the GNU libstdc++ effort."> <meta name="DESCRIPTION" content="README for the GNU libstdc++ effort." />
<meta name="GENERATOR" content="vi and eight fingers"> <meta name="GENERATOR" content="vi and eight fingers" />
<title>libstdc++-v3 Installation Instructions</title> <title>libstdc++-v3 Installation Instructions</title>
<link rel="StyleSheet" href="lib3styles.css"> <link rel="StyleSheet" href="lib3styles.css" />
</head> </head>
<body> <body>
...@@ -18,21 +17,22 @@ ...@@ -18,21 +17,22 @@
</p> </p>
<p>To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>. <p>To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
</p>
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<h2>Contents</h2> <h2>Contents</h2>
<ul> <ul>
<li><a href="#prereqs">Tools you will need beforehand</a> <li><a href="#prereqs">Tools you will need beforehand</a></li>
<li><a href="#srcsetup">Setting up the source directories</a> <li><a href="#srcsetup">Setting up the source directories</a></li>
<li><a href="#config">Configuring</a> <li><a href="#config">Configuring</a></li>
<li><a href="#install">Building and installing the library</a> <li><a href="#install">Building and installing the library</a></li>
<li><a href="#postinstall">Post-installation</a> <li><a href="#postinstall">Post-installation</a></li>
<li><a href="#usage">Using the library</a> <li><a href="#usage">Using the library</a></li>
</ul> </ul>
<hr> <hr />
<!-- ####################################################### --> <!-- ####################################################### -->
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
</dd> </dd>
</dl> </dl>
<hr> <hr />
<h2><a name="srcsetup">Setting up the source directories</a></h2> <h2><a name="srcsetup">Setting up the source directories</a></h2>
<p>The following definitions will be used throughout the rest of this <p>The following definitions will be used throughout the rest of this
...@@ -131,15 +131,20 @@ ...@@ -131,15 +131,20 @@
<li><em>gccsrcdir</em>: The directory holding the source of the <li><em>gccsrcdir</em>: The directory holding the source of the
compiler. It should have several subdirectories like compiler. It should have several subdirectories like
<em>gccsrcdir</em>/libiberty and <em>gccsrcdir</em>/gcc. <em>gccsrcdir</em>/libiberty and <em>gccsrcdir</em>/gcc.
</li>
<li><em>libsrcdir</em>: The directory holding the source of the <li><em>libsrcdir</em>: The directory holding the source of the
C++ library. C++ library.
</li>
<li><em>gccbuilddir</em>: The build directory for the compiler <li><em>gccbuilddir</em>: The build directory for the compiler
in <em>gccsrcdir</em>. GCC requires that it be built in in <em>gccsrcdir</em>. GCC requires that it be built in
a different directory than its sources. a different directory than its sources.
</li>
<li><em>libbuilddir</em>: The build directory for libstdc++. <li><em>libbuilddir</em>: The build directory for libstdc++.
</li>
<li><em>destdir</em>: The eventual installation directory for <li><em>destdir</em>: The eventual installation directory for
the compiler/libraries, set with the --prefix option to the compiler/libraries, set with the --prefix option to
the configure script. the configure script.
</li>
</ul> </ul>
<p> Note: </p> <p> Note: </p>
<ol> <ol>
...@@ -147,10 +152,12 @@ ...@@ -147,10 +152,12 @@
library that comes with the compiler, so <em>libsrcdir</em> library that comes with the compiler, so <em>libsrcdir</em>
and <em>libbuilddir</em> must be contained under and <em>libbuilddir</em> must be contained under
<em>gccsrcdir</em> and <em>gccbuilddir</em>, respectively. <em>gccsrcdir</em> and <em>gccbuilddir</em>, respectively.
</li>
<li>The source, build, and installation directories should <li>The source, build, and installation directories should
not be parents of one another; i.e., these should all be not be parents of one another; i.e., these should all be
separate directories. Please don't build out of the separate directories. Please don't build out of the
source directory. source directory.
</li>
</ol> </ol>
<p>Check out or download the GCC sources: the resulting source directory <p>Check out or download the GCC sources: the resulting source directory
...@@ -175,7 +182,7 @@ ...@@ -175,7 +182,7 @@
mv <em>libsrcdir</em> libstdc++-v3</pre> mv <em>libsrcdir</em> libstdc++-v3</pre>
<hr> <hr />
<h2><a name="config">Configuring</a></h2> <h2><a name="config">Configuring</a></h2>
<p>If you have never done this before, you should read the basic <p>If you have never done this before, you should read the basic
<a href="http://gcc.gnu.org/install/">GCC Installation <a href="http://gcc.gnu.org/install/">GCC Installation
...@@ -196,7 +203,7 @@ ...@@ -196,7 +203,7 @@
<em>gccsrcdir</em>/configure --prefix=<em>destdir</em> --other-opts...</pre> <em>gccsrcdir</em>/configure --prefix=<em>destdir</em> --other-opts...</pre>
<hr> <hr />
<h2><a name="install">Building and installing the library</a></h2> <h2><a name="install">Building and installing the library</a></h2>
<p>Now you have a few options:</p> <p>Now you have a few options:</p>
<h3>[re]building <em>everything</em></h3> <h3>[re]building <em>everything</em></h3>
...@@ -236,7 +243,7 @@ ...@@ -236,7 +243,7 @@
make install-target-libstdc++-v3</pre> make install-target-libstdc++-v3</pre>
<hr> <hr />
<h2><a name="postinstall">Post-installation</a></h2> <h2><a name="postinstall">Post-installation</a></h2>
<p>Installation will create the <em>destdir</em> directory and <p>Installation will create the <em>destdir</em> directory and
populate it with subdirectories: populate it with subdirectories:
...@@ -266,7 +273,7 @@ ...@@ -266,7 +273,7 @@
</p> </p>
<hr> <hr />
<h2><a name="usage">Using the library</a></h2> <h2><a name="usage">Using the library</a></h2>
<h3>Find the new library at runtime (shared linking only)</h3> <h3>Find the new library at runtime (shared linking only)</h3>
<p>If you only built a static library (libstdc++.a), or if you <p>If you only built a static library (libstdc++.a), or if you
...@@ -285,16 +292,18 @@ ...@@ -285,16 +292,18 @@
loaded. Be certain that you understand all of the other loaded. Be certain that you understand all of the other
implications and behavior of LD_LIBRARY_PATH first (few implications and behavior of LD_LIBRARY_PATH first (few
people do, and they get into trouble). people do, and they get into trouble).
</li>
<li>Compile the path to find the library at runtime into the <li>Compile the path to find the library at runtime into the
program. This can be done by passing certain options to g++, program. This can be done by passing certain options to g++,
which will in turn pass them on to the linker. The exact which will in turn pass them on to the linker. The exact
format of the options is dependent on which linker you use: format of the options is dependent on which linker you use:
<ul> <ul>
<li>GNU ld (default on Linux):<code> -Wl,--rpath,<em>destdir</em>/lib</code> <li>GNU ld (default on Linux):<code> -Wl,--rpath,<em>destdir</em>/lib</code></li>
<li>IRIX ld:<code> -Wl,-rpath,<em>destdir</em>/lib</code> <li>IRIX ld:<code> -Wl,-rpath,<em>destdir</em>/lib</code></li>
<li>Solaris ld:<code> -Wl,-R<em>destdir</em>/lib</code> <li>Solaris ld:<code> -Wl,-R<em>destdir</em>/lib</code></li>
<li>More...? Let us know! <li>More...? Let us know!</li>
</ul> </ul>
</li>
</ul> </ul>
<p>Use the <code>ldd(1)</code> utility to show which library the system <p>Use the <code>ldd(1)</code> utility to show which library the system
thinks it will get at runtime. thinks it will get at runtime.
...@@ -306,7 +315,7 @@ ...@@ -306,7 +315,7 @@
<!-- <!--
<hr> <hr />
<h2><a name=""></a></h2> <h2><a name=""></a></h2>
<p> <p>
</p> </p>
...@@ -315,7 +324,7 @@ ...@@ -315,7 +324,7 @@
<!-- ####################################################### --> <!-- ####################################################### -->
<hr> <hr />
<p class="fineprint"><em> <p class="fineprint"><em>
See <a href="17_intro/license.html">license.html</a> for copying conditions. See <a href="17_intro/license.html">license.html</a> for copying conditions.
Comments and suggestions are welcome, and may be sent to Comments and suggestions are welcome, and may be sent to
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
BEGIN { BEGIN {
state = "looking"; state = "looking";
entries = 0; entries = 0;
printf (" <li>%s</li>\n", title); printf (" <li>%s\n", title);
printf (" <ul>\n"); printf (" <ul>\n");
} }
...@@ -39,7 +39,7 @@ state == "entries" && /^<\/ul>/ { ...@@ -39,7 +39,7 @@ state == "entries" && /^<\/ul>/ {
END { END {
for (i = 0; i < entries; i++) for (i = 0; i < entries; i++)
printf (" %s\n", entry[i]); printf (" %s\n", entry[i]);
printf (" </ul>\n\n"); printf (" </ul>\n </li>\n\n");
} }
function extract_info(line) { function extract_info(line) {
...@@ -58,7 +58,7 @@ function extract_info(line) { ...@@ -58,7 +58,7 @@ function extract_info(line) {
} }
# visible text # visible text
gsub("</a>","",line); gsub("</a></li>","",line);
start = index(line,"\">") + 2; start = index(line,"\">") + 2;
thistext = substr(line,start); thistext = substr(line,start);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment