evolution.xml: Update for 4.4 and 4.5 releases.

2010-01-05  Benjamin Kosnik  <bkoz@redhat.com>

	* doc/xml/manual/evolution.xml: Update for 4.4 and 4.5 releases.
	* doc/html: Regenerate.

From-SVN: r155661
This commit is contained in:
Benjamin Kosnik 2010-01-05 20:51:05 +00:00 committed by Benjamin Kosnik
parent 43d4b97de4
commit 4396e06315
127 changed files with 1575 additions and 1189 deletions

View File

@ -1,3 +1,8 @@
2010-01-05 Benjamin Kosnik <bkoz@redhat.com>
* doc/xml/manual/evolution.xml: Update for 4.4 and 4.5 releases.
* doc/html: Regenerate.
2010-01-05 Paolo Carlini <paolo.carlini@oracle.com> 2010-01-05 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/38081 PR libstdc++/38081

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>API and Source Level Documentation</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><link rel="home" href="spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk02.html" title="" /><link rel="prev" href="bk02.html" title="" /><link rel="next" href="bk03.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">API and Source Level Documentation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk02.html">Prev</a> </td><th width="60%" align="center"></th><td width="20%" align="right"> <a accesskey="n" href="bk03.html">Next</a></td></tr></table><hr /></div><div class="article" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="api"></a>API and Source Level Documentation</h2></div><div><p class="copyright">Copyright © <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>API and Source Level Documentation</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk02.html" title="" /><link rel="prev" href="bk02.html" title="" /><link rel="next" href="bk03.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">API and Source Level Documentation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk02.html">Prev</a> </td><th width="60%" align="center"></th><td width="20%" align="right"> <a accesskey="n" href="bk03.html">Next</a></td></tr></table><hr /></div><div class="article" title="API and Source Level Documentation"><div class="titlepage"><div><div><h2 class="title"><a id="api"></a>API and Source Level Documentation</h2></div><div><p class="copyright">Copyright ©
2008 2008
<a class="ulink" href="http://www.fsf.org/" target="_top">FSF <a class="ulink" href="http://www.fsf.org/" target="_top">FSF
</a> </a>
</p></div><div><div class="legalnotice"><a id="id596116"></a><p> </p></div><div><div class="legalnotice" title="Legal Notice"><a id="id379526"></a><p>
<a class="link" href="manual/license.html" title="License">License <a class="link" href="manual/license.html" title="License">License
</a> </a>
</p></div></div></div><hr /></div><p> </p></div></div></div><hr /></div><p>
@ -19,22 +19,22 @@ file, looking at inheritance diagrams, etc.
</p><p> </p><p>
The source-level documentation for the most recent releases can be The source-level documentation for the most recent releases can be
viewed online: viewed online:
</p><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
<a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-3.4/index.html" target="_top">for the 3.4 release <a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-3.4/index.html" target="_top">for the 3.4 release
</a> </a>
</p></li><li><p> </p></li><li class="listitem"><p>
<a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.1/index.html" target="_top">for the 4.1 release <a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.1/index.html" target="_top">for the 4.1 release
</a> </a>
</p></li><li><p> </p></li><li class="listitem"><p>
<a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.2/index.html" target="_top">for the 4.2 release <a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.2/index.html" target="_top">for the 4.2 release
</a> </a>
</p></li><li><p> </p></li><li class="listitem"><p>
<a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.3/index.html" target="_top">for the 4.3 release <a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.3/index.html" target="_top">for the 4.3 release
</a> </a>
</p></li><li><p> </p></li><li class="listitem"><p>
<a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.4/index.html" target="_top">for the 4.4 release <a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.4/index.html" target="_top">for the 4.4 release
</a> </a>
</p></li><li><p> </p></li><li class="listitem"><p>
<a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/index.html" target="_top">"the latest collection" <a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/index.html" target="_top">"the latest collection"
</a> </a>
(For the main development tree; see the date on the first page.) (For the main development tree; see the date on the first page.)

View File

@ -1,3 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><link rel="home" href="spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library Documentation" /><link rel="prev" href="manual/backwards.html" title="Backwards Compatibility" /><link rel="next" href="api.html" title="API and Source Level Documentation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="manual/backwards.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr></table><hr /></div><div class="book" lang="en" xml:lang="en"><div class="titlepage"><hr /></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="article"><a href="api.html">API and Source Level Documentation</a></span></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="manual/backwards.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Backwards Compatibility </td><td width="20%" align="center"><a accesskey="h" href="spine.html">Home</a></td><td width="40%" align="right" valign="top"> API and Source Level Documentation</td></tr></table></div></body></html> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library Documentation" /><link rel="prev" href="manual/backwards.html" title="Backwards Compatibility" /><link rel="next" href="api.html" title="API and Source Level Documentation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="manual/backwards.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr></table><hr /></div><div class="book"><div class="titlepage"><hr /></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="article"><a href="api.html">API and Source Level Documentation</a></span></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="manual/backwards.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Backwards Compatibility </td><td width="20%" align="center"><a accesskey="h" href="spine.html">Home</a></td><td width="40%" align="right" valign="top"> API and Source Level Documentation</td></tr></table></div></body></html>

View File

@ -1,3 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><link rel="home" href="spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library Documentation" /><link rel="prev" href="api.html" title="API and Source Level Documentation" /><link rel="next" href="faq.html" title="Frequently Asked Questions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="api.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="faq.html">Next</a></td></tr></table><hr /></div><div class="book" lang="en" xml:lang="en"><div class="titlepage"><hr /></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="article"><a href="faq.html">Frequently Asked Questions</a></span></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="api.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="faq.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">API and Source Level Documentation </td><td width="20%" align="center"><a accesskey="h" href="spine.html">Home</a></td><td width="40%" align="right" valign="top"> Frequently Asked Questions</td></tr></table></div></body></html> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library Documentation" /><link rel="prev" href="api.html" title="API and Source Level Documentation" /><link rel="next" href="faq.html" title="Frequently Asked Questions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="api.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="faq.html">Next</a></td></tr></table><hr /></div><div class="book"><div class="titlepage"><hr /></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="article"><a href="faq.html">Frequently Asked Questions</a></span></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="api.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="faq.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">API and Source Level Documentation </td><td width="20%" align="center"><a accesskey="h" href="spine.html">Home</a></td><td width="40%" align="right" valign="top"> Frequently Asked Questions</td></tr></table></div></body></html>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Frequently Asked Questions</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><link rel="home" href="spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk03.html" title="" /><link rel="prev" href="bk03.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Frequently Asked Questions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk03.html">Prev</a> </td><th width="60%" align="center"></th><td width="20%" align="right"> </td></tr></table><hr /></div><div class="article" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="faq"></a>Frequently Asked Questions</h2></div><div><p class="copyright">Copyright © <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Frequently Asked Questions</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk03.html" title="" /><link rel="prev" href="bk03.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Frequently Asked Questions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk03.html">Prev</a> </td><th width="60%" align="center"></th><td width="20%" align="right"> </td></tr></table><hr /></div><div class="article" title="Frequently Asked Questions"><div class="titlepage"><div><div><h2 class="title"><a id="faq"></a>Frequently Asked Questions</h2></div><div><p class="copyright">Copyright ©
2008 2008
<a class="ulink" href="http://www.fsf.org" target="_top">FSF</a> <a class="ulink" href="http://www.fsf.org" target="_top">FSF</a>
</p></div></div><hr /></div><div class="qandaset"><dl><dt>1. <a href="faq.html#faq.info">General Information</a></dt><dd><dl><dt>1.1. <a href="faq.html#faq.what"> </p></div></div><hr /></div><div class="qandaset" title="Frequently Asked Questions"><a id="id370939"></a><dl><dt>1. <a href="faq.html#faq.info">General Information</a></dt><dd><dl><dt>1.1. <a href="faq.html#faq.what">
What is libstdc++? What is libstdc++?
</a></dt><dt>1.2. <a href="faq.html#faq.why"> </a></dt><dt>1.2. <a href="faq.html#faq.why">
Why should I use libstdc++? Why should I use libstdc++?
@ -91,7 +91,7 @@
What's an ABI and why is it so messy? What's an ABI and why is it so messy?
</a></dt><dt>7.8. <a href="faq.html#faq.size_equals_capacity"> </a></dt><dt>7.8. <a href="faq.html#faq.size_equals_capacity">
How do I make std::vector&lt;T&gt;::capacity() == std::vector&lt;T&gt;::size? How do I make std::vector&lt;T&gt;::capacity() == std::vector&lt;T&gt;::size?
</a></dt></dl></dd></dl><table border="0" summary="Q and A Set"><col align="left" width="1%" /><tbody><tr class="qandadiv"><td align="left" valign="top" colspan="2"><h3 class="title"><a id="faq.info"></a>1. General Information</h3></td></tr><tr class="toc"><td align="left" valign="top" colspan="2"><dl><dt>1.1. <a href="faq.html#faq.what"> </a></dt></dl></dd></dl><table border="0" width="100%" summary="Q and A Set"><col align="left" width="1%" /><col /><tbody><tr class="qandadiv"><td align="left" valign="top" colspan="2"><h3 class="title"><a id="faq.info"></a>1. General Information</h3></td></tr><tr class="toc"><td align="left" valign="top" colspan="2"><dl><dt>1.1. <a href="faq.html#faq.what">
What is libstdc++? What is libstdc++?
</a></dt><dt>1.2. <a href="faq.html#faq.why"> </a></dt><dt>1.2. <a href="faq.html#faq.why">
Why should I use libstdc++? Why should I use libstdc++?
@ -105,7 +105,7 @@
What happened to the older libg++? I need that! What happened to the older libg++? I need that!
</a></dt><dt>1.7. <a href="faq.html#faq.more_questions"> </a></dt><dt>1.7. <a href="faq.html#faq.more_questions">
What if I have more questions? What if I have more questions?
</a></dt></dl></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.what"></a><a id="faq.what.q"></a><p><b>1.1.</b></p></td><td align="left" valign="top"><p> </a></dt></dl></td></tr><tr class="question" title="1.1."><td align="left" valign="top"><a id="faq.what"></a><a id="faq.what.q"></a><p><b>1.1.</b></p></td><td align="left" valign="top"><p>
What is libstdc++? What is libstdc++?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="faq.what.a"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="faq.what.a"></a></td><td align="left" valign="top"><p>
The GNU Standard C++ Library v3 is an ongoing project to The GNU Standard C++ Library v3 is an ongoing project to
@ -115,14 +115,14 @@
bleeding-edge code, the up-to-date source is available over bleeding-edge code, the up-to-date source is available over
anonymous SVN, and can even be browsed over anonymous SVN, and can even be browsed over
the <a class="ulink" href="http://gcc.gnu.org/svn.html" target="_top">web</a>. the <a class="ulink" href="http://gcc.gnu.org/svn.html" target="_top">web</a>.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.why"></a><a id="q-why"></a><p><b>1.2.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="1.2."><td align="left" valign="top"><a id="faq.why"></a><a id="q-why"></a><p><b>1.2.</b></p></td><td align="left" valign="top"><p>
Why should I use libstdc++? Why should I use libstdc++?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-why"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-why"></a></td><td align="left" valign="top"><p>
The completion of the ISO C++ standardization gave the C++ The completion of the ISO C++ standardization gave the C++
community a powerful set of reuseable tools in the form of the C++ community a powerful set of reuseable tools in the form of the C++
Standard Library. However, all existing C++ implementations are Standard Library. However, all existing C++ implementations are
(as the Draft Standard used to say) “<span class="quote">incomplet and (as the Draft Standard used to say) <span class="quote"><span class="quote">incomplet and
incorrekt</span>”, and many suffer from limitations of the compilers incorrekt</span></span>, and many suffer from limitations of the compilers
that use them. that use them.
</p><p> </p><p>
The GNU compiler collection The GNU compiler collection
@ -139,9 +139,9 @@
freely available and fully compliant. (Such as freely available and fully compliant. (Such as
<code class="classname">string</code>, <code class="classname">string</code>,
<code class="classname">vector&lt;&gt;</code>, iostreams, and algorithms.) <code class="classname">vector&lt;&gt;</code>, iostreams, and algorithms.)
Programmers will no longer need to “<span class="quote">roll their own</span> Programmers will no longer need to <span class="quote"><span class="quote">roll their own</span></span>
nor be worried about platform-specific incompatibilities. nor be worried about platform-specific incompatibilities.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.who"></a><a id="q-who"></a><p><b>1.3.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="1.3."><td align="left" valign="top"><a id="faq.who"></a><a id="q-who"></a><p><b>1.3.</b></p></td><td align="left" valign="top"><p>
Who's in charge of it? Who's in charge of it?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-who"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-who"></a></td><td align="left" valign="top"><p>
The libstdc++ project is contributed to by several developers The libstdc++ project is contributed to by several developers
@ -155,13 +155,13 @@
archives, is open to everyone. You can read instructions for archives, is open to everyone. You can read instructions for
doing so on the <a class="ulink" href="http://gcc.gnu.org/libstdc++/" target="_top">homepage</a>. doing so on the <a class="ulink" href="http://gcc.gnu.org/libstdc++/" target="_top">homepage</a>.
If you have questions, ideas, code, or are just curious, sign up! If you have questions, ideas, code, or are just curious, sign up!
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.when"></a><a id="q-when"></a><p><b>1.4.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="1.4."><td align="left" valign="top"><a id="faq.when"></a><a id="q-when"></a><p><b>1.4.</b></p></td><td align="left" valign="top"><p>
When is libstdc++ going to be finished? When is libstdc++ going to be finished?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-when"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-when"></a></td><td align="left" valign="top"><p>
Nathan Myers gave the best of all possible answers, responding to Nathan Myers gave the best of all possible answers, responding to
a Usenet article asking this question: <span class="emphasis"><em>Sooner, if you a Usenet article asking this question: <span class="emphasis"><em>Sooner, if you
help.</em></span> help.</em></span>
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.how"></a><a id="q-how"></a><p><b>1.5.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="1.5."><td align="left" valign="top"><a id="faq.how"></a><a id="q-how"></a><p><b>1.5.</b></p></td><td align="left" valign="top"><p>
How do I contribute to the effort? How do I contribute to the effort?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-how"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-how"></a></td><td align="left" valign="top"><p>
Here is <a class="link" href="manual/appendix_contributing.html" title="Appendix A.  Contributing">a page devoted to Here is <a class="link" href="manual/appendix_contributing.html" title="Appendix A.  Contributing">a page devoted to
@ -172,7 +172,7 @@
anybody who is willing to help write documentation, for example, anybody who is willing to help write documentation, for example,
or has found a bug in code that we all thought was working and is or has found a bug in code that we all thought was working and is
willing to provide details, is more than welcome! willing to provide details, is more than welcome!
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.whereis_old"></a><a id="q-whereis_old"></a><p><b>1.6.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="1.6."><td align="left" valign="top"><a id="faq.whereis_old"></a><a id="q-whereis_old"></a><p><b>1.6.</b></p></td><td align="left" valign="top"><p>
What happened to the older libg++? I need that! What happened to the older libg++? I need that!
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-whereis_old"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-whereis_old"></a></td><td align="left" valign="top"><p>
The most recent libg++ README states that libg++ is no longer The most recent libg++ README states that libg++ is no longer
@ -180,7 +180,7 @@
projects, and is only being kicked along to support older code. projects, and is only being kicked along to support older code.
</p><p> </p><p>
More information in the <a class="link" href="manual/backwards.html" title="Backwards Compatibility">backwards compatibility documentation</a> More information in the <a class="link" href="manual/backwards.html" title="Backwards Compatibility">backwards compatibility documentation</a>
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.more_questions"></a><a id="q-more_questions"></a><p><b>1.7.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="1.7."><td align="left" valign="top"><a id="faq.more_questions"></a><a id="q-more_questions"></a><p><b>1.7.</b></p></td><td align="left" valign="top"><p>
What if I have more questions? What if I have more questions?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-more_questions"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-more_questions"></a></td><td align="left" valign="top"><p>
If you have read the README file, and your question remains If you have read the README file, and your question remains
@ -201,17 +201,17 @@
How is that different from the GNU {Lesser,Library} GPL? How is that different from the GNU {Lesser,Library} GPL?
</a></dt><dt>2.4. <a href="faq.html#faq.license.what_restrictions"> </a></dt><dt>2.4. <a href="faq.html#faq.license.what_restrictions">
I see. So, what restrictions are there on programs that use the library? I see. So, what restrictions are there on programs that use the library?
</a></dt></dl></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.license.what"></a><a id="q-license.what"></a><p><b>2.1.</b></p></td><td align="left" valign="top"><p> </a></dt></dl></td></tr><tr class="question" title="2.1."><td align="left" valign="top"><a id="faq.license.what"></a><a id="q-license.what"></a><p><b>2.1.</b></p></td><td align="left" valign="top"><p>
What are the license terms for libstdc++? What are the license terms for libstdc++?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-license.what"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-license.what"></a></td><td align="left" valign="top"><p>
See <a class="link" href="manual/license.html" title="License">our license description</a> See <a class="link" href="manual/license.html" title="License">our license description</a>
for these and related questions. for these and related questions.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.license.any_program"></a><a id="q-license.any_program"></a><p><b>2.2.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="2.2."><td align="left" valign="top"><a id="faq.license.any_program"></a><a id="q-license.any_program"></a><p><b>2.2.</b></p></td><td align="left" valign="top"><p>
So any program which uses libstdc++ falls under the GPL? So any program which uses libstdc++ falls under the GPL?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-license.any_program"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-license.any_program"></a></td><td align="left" valign="top"><p>
No. The special exception permits use of the library in No. The special exception permits use of the library in
proprietary applications. proprietary applications.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.license.lgpl"></a><a id="q-license.lgpl"></a><p><b>2.3.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="2.3."><td align="left" valign="top"><a id="faq.license.lgpl"></a><a id="q-license.lgpl"></a><p><b>2.3.</b></p></td><td align="left" valign="top"><p>
How is that different from the GNU {Lesser,Library} GPL? How is that different from the GNU {Lesser,Library} GPL?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-license.lgpl"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-license.lgpl"></a></td><td align="left" valign="top"><p>
The LGPL requires that users be able to replace the LGPL code with a The LGPL requires that users be able to replace the LGPL code with a
@ -221,7 +221,7 @@
are expanded inside the code that uses the library. So to allow people are expanded inside the code that uses the library. So to allow people
to replace the library code, someone using the library would have to to replace the library code, someone using the library would have to
distribute their own source, rendering the LGPL equivalent to the GPL. distribute their own source, rendering the LGPL equivalent to the GPL.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.license.what_restrictions"></a><a id="q-license.what_restrictions"></a><p><b>2.4.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="2.4."><td align="left" valign="top"><a id="faq.license.what_restrictions"></a><a id="q-license.what_restrictions"></a><p><b>2.4.</b></p></td><td align="left" valign="top"><p>
I see. So, what restrictions are there on programs that use the library? I see. So, what restrictions are there on programs that use the library?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-license.what_restrictions"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-license.what_restrictions"></a></td><td align="left" valign="top"><p>
None. We encourage such programs to be released as open source, None. We encourage such programs to be released as open source,
@ -234,7 +234,7 @@
What's libsupc++? What's libsupc++?
</a></dt><dt>3.6. <a href="faq.html#faq.size"> </a></dt><dt>3.6. <a href="faq.html#faq.size">
This library is HUGE! This library is HUGE!
</a></dt></dl></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.how_to_install"></a><a id="q-how_to_install"></a><p><b>3.1.</b></p></td><td align="left" valign="top"><p>How do I install libstdc++? </a></dt></dl></td></tr><tr class="question" title="3.1."><td align="left" valign="top"><a id="faq.how_to_install"></a><a id="q-how_to_install"></a><p><b>3.1.</b></p></td><td align="left" valign="top"><p>How do I install libstdc++?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-how_to_install"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-how_to_install"></a></td><td align="left" valign="top"><p>
Often libstdc++ comes pre-installed as an integral part of many Often libstdc++ comes pre-installed as an integral part of many
existing Linux and Unix systems, as well as many embedded existing Linux and Unix systems, as well as many embedded
@ -247,7 +247,7 @@
documentation</a> for detailed documentation</a> for detailed
instructions. You may wish to browse those files ahead instructions. You may wish to browse those files ahead
of time to get a feel for what's required. of time to get a feel for what's required.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.how_to_get_sources"></a><a id="q-how_to_get_sources"></a><p><b>3.2.</b></p></td><td align="left" valign="top"><p>How does one get current libstdc++ sources? </p></td></tr><tr class="question" title="3.2."><td align="left" valign="top"><a id="faq.how_to_get_sources"></a><a id="q-how_to_get_sources"></a><p><b>3.2.</b></p></td><td align="left" valign="top"><p>How does one get current libstdc++ sources?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-how_to_get_sources"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-how_to_get_sources"></a></td><td align="left" valign="top"><p>
Libstdc++ sources for all official releases can be obtained as Libstdc++ sources for all official releases can be obtained as
part of the GCC sources, available from various sites and part of the GCC sources, available from various sites and
@ -265,14 +265,14 @@
quality. The <a class="ulink" href="http://subversion.tigris.org" target="_top"> Subversion quality. The <a class="ulink" href="http://subversion.tigris.org" target="_top"> Subversion
home page</a> has a better description. home page</a> has a better description.
</p><p> </p><p>
The “<span class="quote">anonymous client checkout</span>” feature of SVN is The <span class="quote"><span class="quote">anonymous client checkout</span></span> feature of SVN is
similar to anonymous FTP in that it allows anyone to retrieve similar to anonymous FTP in that it allows anyone to retrieve
the latest libstdc++ sources. the latest libstdc++ sources.
</p><p> </p><p>
For more information For more information
see <a class="ulink" href="http://gcc.gnu.org/svn.html" target="_top"><acronym class="acronym">SVN</acronym> see <a class="ulink" href="http://gcc.gnu.org/svn.html" target="_top"><acronym class="acronym">SVN</acronym>
details</a>. details</a>.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.how_to_test"></a><a id="q-how_to_test"></a><p><b>3.3.</b></p></td><td align="left" valign="top"><p>How do I know if it works? </p></td></tr><tr class="question" title="3.3."><td align="left" valign="top"><a id="faq.how_to_test"></a><a id="q-how_to_test"></a><p><b>3.3.</b></p></td><td align="left" valign="top"><p>How do I know if it works?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-how_to_test"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-how_to_test"></a></td><td align="left" valign="top"><p>
Libstdc++ comes with its own validation testsuite, which includes Libstdc++ comes with its own validation testsuite, which includes
conformance testing, regression testing, ABI testing, and conformance testing, regression testing, ABI testing, and
@ -283,7 +283,7 @@
If you find bugs in the testsuite programs themselves, or if you If you find bugs in the testsuite programs themselves, or if you
think of a new test program that should be added to the suite, think of a new test program that should be added to the suite,
<span class="emphasis"><em>please</em></span> write up your idea and send it to the list! <span class="emphasis"><em>please</em></span> write up your idea and send it to the list!
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.how_to_set_paths"></a><a id="q-how_to_set_paths"></a><p><b>3.4.</b></p></td><td align="left" valign="top"><p>How do I insure that the dynamically linked library will be found? </p></td></tr><tr class="question" title="3.4."><td align="left" valign="top"><a id="faq.how_to_set_paths"></a><a id="q-how_to_set_paths"></a><p><b>3.4.</b></p></td><td align="left" valign="top"><p>How do I insure that the dynamically linked library will be found?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-how_to_set_paths"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-how_to_set_paths"></a></td><td align="left" valign="top"><p>
Depending on your platform and library version, the error message might Depending on your platform and library version, the error message might
be similar to one of the following: be similar to one of the following:
@ -315,7 +315,7 @@
and <span class="command"><strong>ldconfig</strong></span> for more information. The dynamic and <span class="command"><strong>ldconfig</strong></span> for more information. The dynamic
linker has different names on different platforms but the man page linker has different names on different platforms but the man page
is usually called something such as <code class="filename">ld.so/rtld/dld.so</code>. is usually called something such as <code class="filename">ld.so/rtld/dld.so</code>.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.what_is_libsupcxx"></a><a id="q-what_is_libsupcxx"></a><p><b>3.5.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="3.5."><td align="left" valign="top"><a id="faq.what_is_libsupcxx"></a><a id="q-what_is_libsupcxx"></a><p><b>3.5.</b></p></td><td align="left" valign="top"><p>
What's libsupc++? What's libsupc++?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-what_is_libsupcxx"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-what_is_libsupcxx"></a></td><td align="left" valign="top"><p>
If the only functions from <code class="filename">libstdc++.a</code> If the only functions from <code class="filename">libstdc++.a</code>
@ -332,11 +332,11 @@
using anything from the rest of the library, such as IOStreams using anything from the rest of the library, such as IOStreams
or vectors, then you'll still need pieces from or vectors, then you'll still need pieces from
<code class="filename">libstdc++.a</code>. <code class="filename">libstdc++.a</code>.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.size"></a><a id="q-size"></a><p><b>3.6.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="3.6."><td align="left" valign="top"><a id="faq.size"></a><a id="q-size"></a><p><b>3.6.</b></p></td><td align="left" valign="top"><p>
This library is HUGE! This library is HUGE!
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-size"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-size"></a></td><td align="left" valign="top"><p>
Usually the size of libraries on disk isn't noticeable. When a Usually the size of libraries on disk isn't noticeable. When a
link editor (or simply “<span class="quote">linker</span>”) pulls things from a link editor (or simply <span class="quote"><span class="quote">linker</span></span>) pulls things from a
static archive library, only the necessary object files are copied static archive library, only the necessary object files are copied
into your executable, not the entire library. Unfortunately, even into your executable, not the entire library. Unfortunately, even
if you only need a single function or variable from an object file, if you only need a single function or variable from an object file,
@ -379,7 +379,7 @@
Recent GNU/Linux glibc required? Recent GNU/Linux glibc required?
</a></dt><dt>4.8. <a href="faq.html#faq.freebsd_wchar"> </a></dt><dt>4.8. <a href="faq.html#faq.freebsd_wchar">
Can't use wchar_t/wstring on FreeBSD Can't use wchar_t/wstring on FreeBSD
</a></dt></dl></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.other_compilers"></a><a id="q-other_compilers"></a><p><b>4.1.</b></p></td><td align="left" valign="top"><p> </a></dt></dl></td></tr><tr class="question" title="4.1."><td align="left" valign="top"><a id="faq.other_compilers"></a><a id="q-other_compilers"></a><p><b>4.1.</b></p></td><td align="left" valign="top"><p>
Can libstdc++ be used with non-GNU compilers? Can libstdc++ be used with non-GNU compilers?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-other_compilers"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-other_compilers"></a></td><td align="left" valign="top"><p>
Perhaps. Perhaps.
@ -399,7 +399,7 @@
been known to work with versions of the EDG C++ compiler, and been known to work with versions of the EDG C++ compiler, and
vendor-specific proprietary C++ compilers such as the Intel ICC vendor-specific proprietary C++ compilers such as the Intel ICC
C++ compiler. C++ compiler.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.solaris_long_long"></a><a id="q-solaris_long_long"></a><p><b>4.2.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="4.2."><td align="left" valign="top"><a id="faq.solaris_long_long"></a><a id="q-solaris_long_long"></a><p><b>4.2.</b></p></td><td align="left" valign="top"><p>
No 'long long' type on Solaris? No 'long long' type on Solaris?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-solaris_long_long"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-solaris_long_long"></a></td><td align="left" valign="top"><p>
By default we try to support the C99 <span class="type">long long</span> type. By default we try to support the C99 <span class="type">long long</span> type.
@ -411,7 +411,7 @@
commonly reported platform affected was Solaris. commonly reported platform affected was Solaris.
</p><p> </p><p>
This has been fixed for libstdc++ releases greater than 3.0.3. This has been fixed for libstdc++ releases greater than 3.0.3.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.predefined"></a><a id="q-predefined"></a><p><b>4.3.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="4.3."><td align="left" valign="top"><a id="faq.predefined"></a><a id="q-predefined"></a><p><b>4.3.</b></p></td><td align="left" valign="top"><p>
<code class="constant">_XOPEN_SOURCE</code> and <code class="constant">_GNU_SOURCE</code> are always defined? <code class="constant">_XOPEN_SOURCE</code> and <code class="constant">_GNU_SOURCE</code> are always defined?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-predefined"></a></td><td align="left" valign="top"><p>On Solaris, g++ (but not gcc) always defines the preprocessor </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-predefined"></a></td><td align="left" valign="top"><p>On Solaris, g++ (but not gcc) always defines the preprocessor
macro <code class="constant">_XOPEN_SOURCE</code>. On GNU/Linux, the same happens macro <code class="constant">_XOPEN_SOURCE</code>. On GNU/Linux, the same happens
@ -440,13 +440,13 @@
<a class="ulink" href="http://gcc.gnu.org/cgi-bin/htsearch?method=and&amp;format=builtin-long&amp;sort=score&amp;words=_XOPEN_SOURCE+Solaris" target="_top">quite a bit</a>. <a class="ulink" href="http://gcc.gnu.org/cgi-bin/htsearch?method=and&amp;format=builtin-long&amp;sort=score&amp;words=_XOPEN_SOURCE+Solaris" target="_top">quite a bit</a>.
</p><p>This method is something of a wart. We'd like to find a cleaner </p><p>This method is something of a wart. We'd like to find a cleaner
solution, but nobody yet has contributed the time. solution, but nobody yet has contributed the time.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.darwin_ctype"></a><a id="q-darwin_ctype"></a><p><b>4.4.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="4.4."><td align="left" valign="top"><a id="faq.darwin_ctype"></a><a id="q-darwin_ctype"></a><p><b>4.4.</b></p></td><td align="left" valign="top"><p>
Mac OS X <code class="filename">ctype.h</code> is broken! How can I fix it? Mac OS X <code class="filename">ctype.h</code> is broken! How can I fix it?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-darwin_ctype"></a></td><td align="left" valign="top"><p>This is a long-standing bug in the OS X support. Fortunately, </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-darwin_ctype"></a></td><td align="left" valign="top"><p>This is a long-standing bug in the OS X support. Fortunately,
the patch is quite simple, and well-known. the patch is quite simple, and well-known.
<a class="ulink" href="http://gcc.gnu.org/ml/gcc/2002-03/msg00817.html" target="_top"> Here's a <a class="ulink" href="http://gcc.gnu.org/ml/gcc/2002-03/msg00817.html" target="_top"> Here's a
link to the solution</a>. link to the solution</a>.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.threads_i386"></a><a id="q-threads_i386"></a><p><b>4.5.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="4.5."><td align="left" valign="top"><a id="faq.threads_i386"></a><a id="q-threads_i386"></a><p><b>4.5.</b></p></td><td align="left" valign="top"><p>
Threading is broken on i386? Threading is broken on i386?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-threads_i386"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-threads_i386"></a></td><td align="left" valign="top"><p>
</p><p>Support for atomic integer operations is/was broken on i386 </p><p>Support for atomic integer operations is/was broken on i386
@ -456,7 +456,7 @@
on an i686, then you would encounter no problems. Only when on an i686, then you would encounter no problems. Only when
actually running the code on a i386 will the problem appear. actually running the code on a i386 will the problem appear.
</p><p>This is fixed in 3.2.2. </p><p>This is fixed in 3.2.2.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.atomic_mips"></a><a id="q-atomic_mips"></a><p><b>4.6.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="4.6."><td align="left" valign="top"><a id="faq.atomic_mips"></a><a id="q-atomic_mips"></a><p><b>4.6.</b></p></td><td align="left" valign="top"><p>
MIPS atomic operations MIPS atomic operations
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-atomic_mips"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-atomic_mips"></a></td><td align="left" valign="top"><p>
The atomic locking routines for MIPS targets requires MIPS II The atomic locking routines for MIPS targets requires MIPS II
@ -466,7 +466,7 @@
</p><p> </p><p>
The mips*-*-linux* port continues to use the MIPS II routines, and more The mips*-*-linux* port continues to use the MIPS II routines, and more
work in this area is expected. work in this area is expected.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.linux_glibc"></a><a id="q-linux_glibc"></a><p><b>4.7.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="4.7."><td align="left" valign="top"><a id="faq.linux_glibc"></a><a id="q-linux_glibc"></a><p><b>4.7.</b></p></td><td align="left" valign="top"><p>
Recent GNU/Linux glibc required? Recent GNU/Linux glibc required?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-linux_glibc"></a></td><td align="left" valign="top"><p>When running on GNU/Linux, libstdc++ 3.2.1 (shared library version </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-linux_glibc"></a></td><td align="left" valign="top"><p>When running on GNU/Linux, libstdc++ 3.2.1 (shared library version
5.0.1) and later uses localization and formatting code from the system 5.0.1) and later uses localization and formatting code from the system
@ -476,7 +476,7 @@
</p><p>The guideline is simple: the more recent the C++ library, the </p><p>The guideline is simple: the more recent the C++ library, the
more recent the C library. (This is also documented in the main more recent the C library. (This is also documented in the main
GCC installation instructions.) GCC installation instructions.)
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.freebsd_wchar"></a><a id="q-freebsd_wchar"></a><p><b>4.8.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="4.8."><td align="left" valign="top"><a id="faq.freebsd_wchar"></a><a id="q-freebsd_wchar"></a><p><b>4.8.</b></p></td><td align="left" valign="top"><p>
Can't use wchar_t/wstring on FreeBSD Can't use wchar_t/wstring on FreeBSD
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-freebsd_wchar"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-freebsd_wchar"></a></td><td align="left" valign="top"><p>
Older versions of FreeBSD's C library do not have sufficient Older versions of FreeBSD's C library do not have sufficient
@ -495,7 +495,7 @@
Bugs in the ISO C++ language or library specification Bugs in the ISO C++ language or library specification
</a></dt><dt>5.3. <a href="faq.html#faq.compiler_bugs"> </a></dt><dt>5.3. <a href="faq.html#faq.compiler_bugs">
Bugs in the compiler (gcc/g++) and not libstdc++ Bugs in the compiler (gcc/g++) and not libstdc++
</a></dt></dl></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.what_works"></a><a id="q-what_works"></a><p><b>5.1.</b></p></td><td align="left" valign="top"><p> </a></dt></dl></td></tr><tr class="question" title="5.1."><td align="left" valign="top"><a id="faq.what_works"></a><a id="q-what_works"></a><p><b>5.1.</b></p></td><td align="left" valign="top"><p>
What works already? What works already?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-what_works"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-what_works"></a></td><td align="left" valign="top"><p>
Short answer: Pretty much everything <span class="emphasis"><em>works</em></span> Short answer: Pretty much everything <span class="emphasis"><em>works</em></span>
@ -509,7 +509,7 @@
<a class="link" href="manual/status.html#status.iso.1998" title="C++ 1998/2003">C++98</a>, <a class="link" href="manual/status.html#status.iso.1998" title="C++ 1998/2003">C++98</a>,
<a class="link" href="manual/status.html#status.iso.tr1" title="C++ TR1">TR1</a>, and <a class="link" href="manual/status.html#status.iso.tr1" title="C++ TR1">TR1</a>, and
<a class="link" href="manual/status.html#status.iso.200x" title="C++ 200x">C++0x</a>. <a class="link" href="manual/status.html#status.iso.200x" title="C++ 200x">C++0x</a>.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.standard_bugs"></a><a id="q-standard_bugs"></a><p><b>5.2.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="5.2."><td align="left" valign="top"><a id="faq.standard_bugs"></a><a id="q-standard_bugs"></a><p><b>5.2.</b></p></td><td align="left" valign="top"><p>
Bugs in the ISO C++ language or library specification Bugs in the ISO C++ language or library specification
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-standard_bugs"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-standard_bugs"></a></td><td align="left" valign="top"><p>
Unfortunately, there are some. Unfortunately, there are some.
@ -524,7 +524,7 @@
please post a message describing your problem please post a message describing your problem
to <code class="email">&lt;<a class="email" href="mailto:libstdc++@gcc.gnu.org">libstdc++@gcc.gnu.org</a>&gt;</code> or the Usenet group to <code class="email">&lt;<a class="email" href="mailto:libstdc++@gcc.gnu.org">libstdc++@gcc.gnu.org</a>&gt;</code> or the Usenet group
comp.lang.c++.moderated. comp.lang.c++.moderated.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.compiler_bugs"></a><a id="q-compiler_bugs"></a><p><b>5.3.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="5.3."><td align="left" valign="top"><a id="faq.compiler_bugs"></a><a id="q-compiler_bugs"></a><p><b>5.3.</b></p></td><td align="left" valign="top"><p>
Bugs in the compiler (gcc/g++) and not libstdc++ Bugs in the compiler (gcc/g++) and not libstdc++
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-compiler_bugs"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-compiler_bugs"></a></td><td align="left" valign="top"><p>
On occasion, the compiler is wrong. Please be advised that this On occasion, the compiler is wrong. Please be advised that this
@ -538,7 +538,7 @@
</p><p> </p><p>
Before reporting a bug, please examine the Before reporting a bug, please examine the
<a class="ulink" href="http://gcc.gnu.org/bugs.html" target="_top">bugs database</a> with the <a class="ulink" href="http://gcc.gnu.org/bugs.html" target="_top">bugs database</a> with the
category set to “<span class="quote">g++</span>”. category set to <span class="quote"><span class="quote">g++</span></span>.
</p></td></tr><tr class="qandadiv"><td align="left" valign="top" colspan="2"><h3 class="title"><a id="faq.known_non-bugs"></a>6. Known Non-Bugs</h3></td></tr><tr class="toc"><td align="left" valign="top" colspan="2"><dl><dt>6.1. <a href="faq.html#faq.stream_reopening_fails"> </p></td></tr><tr class="qandadiv"><td align="left" valign="top" colspan="2"><h3 class="title"><a id="faq.known_non-bugs"></a>6. Known Non-Bugs</h3></td></tr><tr class="toc"><td align="left" valign="top" colspan="2"><dl><dt>6.1. <a href="faq.html#faq.stream_reopening_fails">
Reopening a stream fails Reopening a stream fails
</a></dt><dt>6.2. <a href="faq.html#faq.wefcxx_verbose"> </a></dt><dt>6.2. <a href="faq.html#faq.wefcxx_verbose">
@ -559,19 +559,19 @@
list::size() is O(n)! list::size() is O(n)!
</a></dt><dt>6.9. <a href="faq.html#faq.easy_to_fix"> </a></dt><dt>6.9. <a href="faq.html#faq.easy_to_fix">
Aw, that's easy to fix! Aw, that's easy to fix!
</a></dt></dl></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.stream_reopening_fails"></a><a id="q-stream_reopening_fails"></a><p><b>6.1.</b></p></td><td align="left" valign="top"><p> </a></dt></dl></td></tr><tr class="question" title="6.1."><td align="left" valign="top"><a id="faq.stream_reopening_fails"></a><a id="q-stream_reopening_fails"></a><p><b>6.1.</b></p></td><td align="left" valign="top"><p>
Reopening a stream fails Reopening a stream fails
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-stream_reopening_fails"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-stream_reopening_fails"></a></td><td align="left" valign="top"><p>
One of the most-reported non-bug reports. Executing a sequence like: One of the most-reported non-bug reports. Executing a sequence like:
</p><div class="literallayout"><p><br /> </p><div class="literallayout"><p><br />
    #include &lt;fstream&gt;<br />     #include &lt;fstream&gt;<br />
    ...<br />     ...<br />
    std::fstream  fs(“<span class="quote">a_file</span>”);<br />     std::fstream  fs(<span class="quote"><span class="quote">a_file</span></span>);<br />
    // .<br />     // .<br />
    // . do things with fs...<br />     // . do things with fs...<br />
    // .<br />     // .<br />
    fs.close();<br />     fs.close();<br />
    fs.open(“<span class="quote">a_new_file</span>”);<br />     fs.open(<span class="quote"><span class="quote">a_new_file</span></span>);<br />
    </p></div><p>     </p></div><p>
All operations on the re-opened <code class="varname">fs</code> will fail, or at All operations on the re-opened <code class="varname">fs</code> will fail, or at
least act very strangely. Yes, they often will, especially if least act very strangely. Yes, they often will, especially if
@ -586,7 +586,7 @@
<span class="emphasis"><em>Update:</em></span> for GCC 4.0 we implemented the resolution <span class="emphasis"><em>Update:</em></span> for GCC 4.0 we implemented the resolution
of <a class="link" href="manual/bugs.html" title="Bugs">DR #409</a> and open() of <a class="link" href="manual/bugs.html" title="Bugs">DR #409</a> and open()
now calls <code class="function">clear()</code> on success! now calls <code class="function">clear()</code> on success!
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.wefcxx_verbose"></a><a id="q-wefcxx_verbose"></a><p><b>6.2.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="6.2."><td align="left" valign="top"><a id="faq.wefcxx_verbose"></a><a id="q-wefcxx_verbose"></a><p><b>6.2.</b></p></td><td align="left" valign="top"><p>
-Weffc++ complains too much -Weffc++ complains too much
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-wefcxx_verbose"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-wefcxx_verbose"></a></td><td align="left" valign="top"><p>
Many warnings are emitted when <code class="literal">-Weffc++</code> is used. Making Many warnings are emitted when <code class="literal">-Weffc++</code> is used. Making
@ -598,19 +598,19 @@
We do, however, try to have libstdc++ sources as clean as possible. If We do, however, try to have libstdc++ sources as clean as possible. If
you see some simple changes that pacify <code class="literal">-Weffc++</code> you see some simple changes that pacify <code class="literal">-Weffc++</code>
without other drawbacks, send us a patch. without other drawbacks, send us a patch.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.ambiguous_overloads"></a><a id="q-ambiguous_overloads"></a><p><b>6.3.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="6.3."><td align="left" valign="top"><a id="faq.ambiguous_overloads"></a><a id="q-ambiguous_overloads"></a><p><b>6.3.</b></p></td><td align="left" valign="top"><p>
Ambiguous overloads after including an old-style header Ambiguous overloads after including an old-style header
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-ambiguous_overloads"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-ambiguous_overloads"></a></td><td align="left" valign="top"><p>
Another problem is the <code class="literal">rel_ops</code> namespace and the template Another problem is the <code class="literal">rel_ops</code> namespace and the template
comparison operator functions contained therein. If they become comparison operator functions contained therein. If they become
visible in the same namespace as other comparison functions visible in the same namespace as other comparison functions
(e.g., “<span class="quote">using</span>” them and the &lt;iterator&gt; header), (e.g., <span class="quote"><span class="quote">using</span></span> them and the &lt;iterator&gt; header),
then you will suddenly be faced with huge numbers of ambiguity then you will suddenly be faced with huge numbers of ambiguity
errors. This was discussed on the -v3 list; Nathan Myers errors. This was discussed on the -v3 list; Nathan Myers
<a class="ulink" href="http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html" target="_top">sums <a class="ulink" href="http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html" target="_top">sums
things up here</a>. The collisions with vector/string iterator things up here</a>. The collisions with vector/string iterator
types have been fixed for 3.1. types have been fixed for 3.1.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.v2_headers"></a><a id="q-v2_headers"></a><p><b>6.4.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="6.4."><td align="left" valign="top"><a id="faq.v2_headers"></a><a id="q-v2_headers"></a><p><b>6.4.</b></p></td><td align="left" valign="top"><p>
The g++-3 headers are <span class="emphasis"><em>not ours</em></span> The g++-3 headers are <span class="emphasis"><em>not ours</em></span>
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-v2_headers"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-v2_headers"></a></td><td align="left" valign="top"><p>
If you have found an extremely broken header file which is If you have found an extremely broken header file which is
@ -633,7 +633,7 @@
'v'?). Starting with version 3.2 the headers are installed in 'v'?). Starting with version 3.2 the headers are installed in
<code class="filename">${prefix}/include/c++/${version}</code> as this prevents <code class="filename">${prefix}/include/c++/${version}</code> as this prevents
headers from previous versions being found by mistake. headers from previous versions being found by mistake.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.boost_concept_checks"></a><a id="q-boost_concept_checks"></a><p><b>6.5.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="6.5."><td align="left" valign="top"><a id="faq.boost_concept_checks"></a><a id="q-boost_concept_checks"></a><p><b>6.5.</b></p></td><td align="left" valign="top"><p>
Errors about <span class="emphasis"><em>*Concept</em></span> and Errors about <span class="emphasis"><em>*Concept</em></span> and
<span class="emphasis"><em>constraints</em></span> in the STL <span class="emphasis"><em>constraints</em></span> in the STL
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-boost_concept_checks"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-boost_concept_checks"></a></td><td align="left" valign="top"><p>
@ -649,7 +649,7 @@
More information, including how to optionally enable/disable the More information, including how to optionally enable/disable the
checks, is available checks, is available
<a class="link" href="manual/bk01pt03ch08.html" title="Chapter 8. Concept Checking">here</a>. <a class="link" href="manual/bk01pt03ch08.html" title="Chapter 8. Concept Checking">here</a>.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.dlopen_crash"></a><a id="q-dlopen_crash"></a><p><b>6.6.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="6.6."><td align="left" valign="top"><a id="faq.dlopen_crash"></a><a id="q-dlopen_crash"></a><p><b>6.6.</b></p></td><td align="left" valign="top"><p>
Program crashes when using library code in a Program crashes when using library code in a
dynamically-loaded library dynamically-loaded library
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-dlopen_crash"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-dlopen_crash"></a></td><td align="left" valign="top"><p>
@ -668,8 +668,8 @@
<br /> <br />
    // link the executable<br />     // link the executable<br />
    g++ -fPIC -rdynamic -o foo ... -L. -lfoo -ldl<br />     g++ -fPIC -rdynamic -o foo ... -L. -lfoo -ldl<br />
    </p></div></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.memory_leaks"></a><a id="q-memory_leaks"></a><p><b>6.7.</b></p></td><td align="left" valign="top"><p>     </p></div></td></tr><tr class="question" title="6.7."><td align="left" valign="top"><a id="faq.memory_leaks"></a><a id="q-memory_leaks"></a><p><b>6.7.</b></p></td><td align="left" valign="top"><p>
<span class="quote">Memory leaks</span>” in containers <span class="quote"><span class="quote">Memory leaks</span></span> in containers
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-memory_leaks"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-memory_leaks"></a></td><td align="left" valign="top"><p>
A few people have reported that the standard containers appear A few people have reported that the standard containers appear
to leak memory when tested with memory checkers such as to leak memory when tested with memory checkers such as
@ -681,13 +681,13 @@
want to test the library for memory leaks please read want to test the library for memory leaks please read
<a class="link" href="manual/debug.html#debug.memory" title="Memory Leak Hunting">Tips for memory leak hunting</a> <a class="link" href="manual/debug.html#debug.memory" title="Memory Leak Hunting">Tips for memory leak hunting</a>
first. first.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.list_size_on"></a><a id="q-list_size_on"></a><p><b>6.8.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="6.8."><td align="left" valign="top"><a id="faq.list_size_on"></a><a id="q-list_size_on"></a><p><b>6.8.</b></p></td><td align="left" valign="top"><p>
list::size() is O(n)! list::size() is O(n)!
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-list_size_on"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-list_size_on"></a></td><td align="left" valign="top"><p>
See See
the <a class="link" href="manual/containers.html" title="Part VII.  Containers">Containers</a> the <a class="link" href="manual/containers.html" title="Part VII.  Containers">Containers</a>
chapter. chapter.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.easy_to_fix"></a><a id="q-easy_to_fix"></a><p><b>6.9.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="6.9."><td align="left" valign="top"><a id="faq.easy_to_fix"></a><a id="q-easy_to_fix"></a><p><b>6.9.</b></p></td><td align="left" valign="top"><p>
Aw, that's easy to fix! Aw, that's easy to fix!
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-easy_to_fix"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-easy_to_fix"></a></td><td align="left" valign="top"><p>
If you have found a bug in the library and you think you have If you have found a bug in the library and you think you have
@ -720,7 +720,7 @@
What's an ABI and why is it so messy? What's an ABI and why is it so messy?
</a></dt><dt>7.8. <a href="faq.html#faq.size_equals_capacity"> </a></dt><dt>7.8. <a href="faq.html#faq.size_equals_capacity">
How do I make std::vector&lt;T&gt;::capacity() == std::vector&lt;T&gt;::size? How do I make std::vector&lt;T&gt;::capacity() == std::vector&lt;T&gt;::size?
</a></dt></dl></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.iterator_as_pod"></a><a id="faq.iterator_as_pod_q"></a><p><b>7.1.</b></p></td><td align="left" valign="top"><p> </a></dt></dl></td></tr><tr class="question" title="7.1."><td align="left" valign="top"><a id="faq.iterator_as_pod"></a><a id="faq.iterator_as_pod_q"></a><p><b>7.1.</b></p></td><td align="left" valign="top"><p>
string::iterator is not char*; vector&lt;T&gt;::iterator is not T* string::iterator is not char*; vector&lt;T&gt;::iterator is not T*
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="faq.iterator_as_pod_a"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="faq.iterator_as_pod_a"></a></td><td align="left" valign="top"><p>
If you have code that depends on container&lt;T&gt; iterators If you have code that depends on container&lt;T&gt; iterators
@ -739,7 +739,7 @@
certain expressions to <code class="varname">&amp;*i</code>. Future revisions certain expressions to <code class="varname">&amp;*i</code>. Future revisions
of the Standard are expected to bless this usage for of the Standard are expected to bless this usage for
vector&lt;&gt; (but not for basic_string&lt;&gt;). vector&lt;&gt; (but not for basic_string&lt;&gt;).
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.what_is_next"></a><a id="q-what_is_next"></a><p><b>7.2.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="7.2."><td align="left" valign="top"><a id="faq.what_is_next"></a><a id="q-what_is_next"></a><p><b>7.2.</b></p></td><td align="left" valign="top"><p>
What's next after libstdc++? What's next after libstdc++?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-what_is_next"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-what_is_next"></a></td><td align="left" valign="top"><p>
Hopefully, not much. The goal of libstdc++ is to produce a Hopefully, not much. The goal of libstdc++ is to produce a
@ -752,7 +752,7 @@
this effort is described in this effort is described in
<a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" target="_top"> <a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" target="_top">
The C++ Library Technical Report 1</a>. The C++ Library Technical Report 1</a>.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.sgi_stl"></a><a id="q-sgi_stl"></a><p><b>7.3.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="7.3."><td align="left" valign="top"><a id="faq.sgi_stl"></a><a id="q-sgi_stl"></a><p><b>7.3.</b></p></td><td align="left" valign="top"><p>
What about the STL from SGI? What about the STL from SGI?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-sgi_stl"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-sgi_stl"></a></td><td align="left" valign="top"><p>
The <a class="ulink" href="http://www.sgi.com/tech/stl/" target="_top">STL from SGI</a>, The <a class="ulink" href="http://www.sgi.com/tech/stl/" target="_top">STL from SGI</a>,
@ -775,11 +775,11 @@
</p><p> </p><p>
The FAQ for SGI's STL (one jump off of their main page) is The FAQ for SGI's STL (one jump off of their main page) is
still recommended reading. still recommended reading.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.extensions_and_backwards_compat"></a><a id="q-extensions_and_backwards_compat"></a><p><b>7.4.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="7.4."><td align="left" valign="top"><a id="faq.extensions_and_backwards_compat"></a><a id="q-extensions_and_backwards_compat"></a><p><b>7.4.</b></p></td><td align="left" valign="top"><p>
Extensions and Backward Compatibility Extensions and Backward Compatibility
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-extensions_and_backwards_compat"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-extensions_and_backwards_compat"></a></td><td align="left" valign="top"><p>
See the <a class="link" href="manual/backwards.html" title="Backwards Compatibility">link</a> on backwards compatibility and <a class="link" href="manual/api.html" title="API Evolution and Deprecation History">link</a> on evolution. See the <a class="link" href="manual/backwards.html" title="Backwards Compatibility">link</a> on backwards compatibility and <a class="link" href="manual/api.html" title="API Evolution and Deprecation History">link</a> on evolution.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.tr1_support"></a><a id="q-tr1_support"></a><p><b>7.5.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="7.5."><td align="left" valign="top"><a id="faq.tr1_support"></a><a id="q-tr1_support"></a><p><b>7.5.</b></p></td><td align="left" valign="top"><p>
Does libstdc++ support TR1? Does libstdc++ support TR1?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-tr1_support"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-tr1_support"></a></td><td align="left" valign="top"><p>
Yes. Yes.
@ -791,7 +791,7 @@
</p><p> </p><p>
The implementation status of TR1 in libstdc++ can be tracked <a class="link" href="manual/status.html#status.iso.tr1" title="C++ TR1">on the TR1 status The implementation status of TR1 in libstdc++ can be tracked <a class="link" href="manual/status.html#status.iso.tr1" title="C++ TR1">on the TR1 status
page</a>. page</a>.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.get_iso_cxx"></a><a id="q-get_iso_cxx"></a><p><b>7.6.</b></p></td><td align="left" valign="top"><p>How do I get a copy of the ISO C++ Standard? </p></td></tr><tr class="question" title="7.6."><td align="left" valign="top"><a id="faq.get_iso_cxx"></a><a id="q-get_iso_cxx"></a><p><b>7.6.</b></p></td><td align="left" valign="top"><p>How do I get a copy of the ISO C++ Standard?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-get_iso_cxx"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-get_iso_cxx"></a></td><td align="left" valign="top"><p>
Copies of the full ISO 14882 standard are available on line via Copies of the full ISO 14882 standard are available on line via
the ISO mirror site for committee members. Non-members, or those the ISO mirror site for committee members. Non-members, or those
@ -810,11 +810,11 @@
</p><p> </p><p>
The 2003 version of the standard (the 1998 version plus TC1) is The 2003 version of the standard (the 1998 version plus TC1) is
available in print, ISBN 0-470-84674-7. available in print, ISBN 0-470-84674-7.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.what_is_abi"></a><a id="q-what_is_abi"></a><p><b>7.7.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="7.7."><td align="left" valign="top"><a id="faq.what_is_abi"></a><a id="q-what_is_abi"></a><p><b>7.7.</b></p></td><td align="left" valign="top"><p>
What's an ABI and why is it so messy? What's an ABI and why is it so messy?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-what_is_abi"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-what_is_abi"></a></td><td align="left" valign="top"><p>
<acronym class="acronym">ABI</acronym> stands for “<span class="quote">Application Binary <acronym class="acronym">ABI</acronym> stands for <span class="quote"><span class="quote">Application Binary
Interface</span>”. Conventionally, it refers to a great Interface</span></span>. Conventionally, it refers to a great
mass of details about how arguments are arranged on the call mass of details about how arguments are arranged on the call
stack and/or in registers, and how various types are arranged stack and/or in registers, and how various types are arranged
and padded in structs. A single CPU design may suffer and padded in structs. A single CPU design may suffer
@ -836,7 +836,7 @@
virtual function implementation, struct inheritance layout, name virtual function implementation, struct inheritance layout, name
mangling, and exception handling. Such an ABI has been defined for mangling, and exception handling. Such an ABI has been defined for
GNU C++, and is immediately useful for embedded work relying only on GNU C++, and is immediately useful for embedded work relying only on
a “<span class="quote">free-standing implementation</span>” that doesn't include (much a <span class="quote"><span class="quote">free-standing implementation</span></span> that doesn't include (much
of) the standard library. It is a good basis for the work to come. of) the standard library. It is a good basis for the work to come.
</p><p> </p><p>
A useful C++ ABI must also incorporate many details of the standard A useful C++ ABI must also incorporate many details of the standard
@ -858,7 +858,7 @@
so they may later be changed. Deciding which, and implementing so they may later be changed. Deciding which, and implementing
the decisions, must happen before you can reasonably document a the decisions, must happen before you can reasonably document a
candidate C++ ABI that encompasses the standard library. candidate C++ ABI that encompasses the standard library.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.size_equals_capacity"></a><a id="q-size_equals_capacity"></a><p><b>7.8.</b></p></td><td align="left" valign="top"><p> </p></td></tr><tr class="question" title="7.8."><td align="left" valign="top"><a id="faq.size_equals_capacity"></a><a id="q-size_equals_capacity"></a><p><b>7.8.</b></p></td><td align="left" valign="top"><p>
How do I make std::vector&lt;T&gt;::capacity() == std::vector&lt;T&gt;::size? How do I make std::vector&lt;T&gt;::capacity() == std::vector&lt;T&gt;::size?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-size_equals_capacity"></a></td><td align="left" valign="top"><p> </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-size_equals_capacity"></a></td><td align="left" valign="top"><p>
The standard idiom for deallocating a <code class="classname">vector&lt;T&gt;</code>'s The standard idiom for deallocating a <code class="classname">vector&lt;T&gt;</code>'s

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ABI Policy and Guidelines</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; ABI&#10; , &#10; version&#10; , &#10; dynamic&#10; , &#10; shared&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="test.html" title="Test" /><link rel="next" href="api.html" title="API Evolution and Deprecation History" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ABI Policy and Guidelines</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="test.html">Prev</a> </td><th width="60%" align="center">Appendix B.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ABI Policy and Guidelines</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; ABI&#10; , &#10; version&#10; , &#10; dynamic&#10; , &#10; shared&#10; , &#10; compatibility&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="test.html" title="Test" /><link rel="next" href="api.html" title="API Evolution and Deprecation History" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ABI Policy and Guidelines</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="test.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance Porting and Maintenance
</th><td width="20%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appendix.porting.abi"></a>ABI Policy and Guidelines</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="api.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="ABI Policy and Guidelines"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appendix.porting.abi"></a>ABI Policy and Guidelines</h2></div></div></div><p>
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="abi.cxx_interface"></a>The C++ Interface</h3></div></div></div><p> </p><div class="sect2" title="The C++ Interface"><div class="titlepage"><div><div><h3 class="title"><a id="abi.cxx_interface"></a>The C++ Interface</h3></div></div></div><p>
C++ applications often dependent on specific language support C++ applications often dependent on specific language support
routines, say for throwing exceptions, or catching exceptions, and routines, say for throwing exceptions, or catching exceptions, and
perhaps also dependent on features in the C++ Standard Library. perhaps also dependent on features in the C++ Standard Library.
@ -42,9 +42,9 @@
library ABI, which is the compilation of a given library API by a library ABI, which is the compilation of a given library API by a
given compiler ABI. In a nutshell: given compiler ABI. In a nutshell:
</p><p> </p><p>
<span class="quote"> <span class="quote"><span class="quote">
library API + compiler ABI = library ABI library API + compiler ABI = library ABI
</span> </span></span>
</p><p> </p><p>
The library ABI is mostly of interest for end-users who have The library ABI is mostly of interest for end-users who have
unresolved symbols and are linking dynamically to the C++ Standard unresolved symbols and are linking dynamically to the C++ Standard
@ -58,10 +58,10 @@ given compiler ABI. In a nutshell:
To use a specific version of the C++ ABI, one must use a To use a specific version of the C++ ABI, one must use a
corresponding GNU C++ toolchain (i.e., g++ and libstdc++) that corresponding GNU C++ toolchain (i.e., g++ and libstdc++) that
implements the C++ ABI in question. implements the C++ ABI in question.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="abi.versioning"></a>Versioning</h3></div></div></div><p> The C++ interface has evolved throughout the history of the GNU </p></div><div class="sect2" title="Versioning"><div class="titlepage"><div><div><h3 class="title"><a id="abi.versioning"></a>Versioning</h3></div></div></div><p> The C++ interface has evolved throughout the history of the GNU
C++ toolchain. With each release, various details have been changed so C++ toolchain. With each release, various details have been changed so
as to give distinct versions to the C++ interface. as to give distinct versions to the C++ interface.
</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="abi.versioning.goals"></a>Goals</h4></div></div></div><p>Extending existing, stable ABIs. Versioning gives subsequent </p><div class="sect3" title="Goals"><div class="titlepage"><div><div><h4 class="title"><a id="abi.versioning.goals"></a>Goals</h4></div></div></div><p>Extending existing, stable ABIs. Versioning gives subsequent
releases of library binaries the ability to add new symbols and add releases of library binaries the ability to add new symbols and add
functionality, all the while retaining compatibility with the previous functionality, all the while retaining compatibility with the previous
releases in the series. Thus, program binaries linked with the initial releases in the series. Thus, program binaries linked with the initial
@ -75,7 +75,7 @@ binary in a release series (with additional symbols added), substitute
in the initial release of the library binary, and remain link in the initial release of the library binary, and remain link
compatible. compatible.
</p><p>Allows multiple, incompatible ABIs to coexist at the same time. </p><p>Allows multiple, incompatible ABIs to coexist at the same time.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="abi.versioning.history"></a>History</h4></div></div></div><p> </p></div><div class="sect3" title="History"><div class="titlepage"><div><div><h4 class="title"><a id="abi.versioning.history"></a>History</h4></div></div></div><p>
How can this complexity be managed? What does C++ versioning mean? How can this complexity be managed? What does C++ versioning mean?
Because library and compiler changes often make binaries compiled Because library and compiler changes often make binaries compiled
with one version of the GNU tools incompatible with binaries with one version of the GNU tools incompatible with binaries
@ -84,17 +84,17 @@ compatible.
easier. easier.
</p><p> </p><p>
The following techniques are used: The following techniques are used:
</p><div class="orderedlist"><ol type="1"><li><p>Release versioning on the libgcc_s.so binary. </p><p>This is implemented via file names and the ELF </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Release versioning on the libgcc_s.so binary. </p><p>This is implemented via file names and the ELF
<code class="constant">DT_SONAME</code> mechanism (at least on ELF <code class="constant">DT_SONAME</code> mechanism (at least on ELF
systems). It is versioned as follows: systems). It is versioned as follows:
</p><div class="itemizedlist"><ul type="disc"><li><p>gcc-3.0.0: libgcc_s.so.1</p></li><li><p>gcc-3.0.1: libgcc_s.so.1</p></li><li><p>gcc-3.0.2: libgcc_s.so.1</p></li><li><p>gcc-3.0.3: libgcc_s.so.1</p></li><li><p>gcc-3.0.4: libgcc_s.so.1</p></li><li><p>gcc-3.1.0: libgcc_s.so.1</p></li><li><p>gcc-3.1.1: libgcc_s.so.1</p></li><li><p>gcc-3.2.0: libgcc_s.so.1</p></li><li><p>gcc-3.2.1: libgcc_s.so.1</p></li><li><p>gcc-3.2.2: libgcc_s.so.1</p></li><li><p>gcc-3.2.3: libgcc_s.so.1</p></li><li><p>gcc-3.3.0: libgcc_s.so.1</p></li><li><p>gcc-3.3.1: libgcc_s.so.1</p></li><li><p>gcc-3.3.2: libgcc_s.so.1</p></li><li><p>gcc-3.3.3: libgcc_s.so.1</p></li><li><p>gcc-3.4.x, gcc-4.[0-3].x: on m68k-linux and </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>gcc-3.0.0: libgcc_s.so.1</p></li><li class="listitem"><p>gcc-3.0.1: libgcc_s.so.1</p></li><li class="listitem"><p>gcc-3.0.2: libgcc_s.so.1</p></li><li class="listitem"><p>gcc-3.0.3: libgcc_s.so.1</p></li><li class="listitem"><p>gcc-3.0.4: libgcc_s.so.1</p></li><li class="listitem"><p>gcc-3.1.0: libgcc_s.so.1</p></li><li class="listitem"><p>gcc-3.1.1: libgcc_s.so.1</p></li><li class="listitem"><p>gcc-3.2.0: libgcc_s.so.1</p></li><li class="listitem"><p>gcc-3.2.1: libgcc_s.so.1</p></li><li class="listitem"><p>gcc-3.2.2: libgcc_s.so.1</p></li><li class="listitem"><p>gcc-3.2.3: libgcc_s.so.1</p></li><li class="listitem"><p>gcc-3.3.0: libgcc_s.so.1</p></li><li class="listitem"><p>gcc-3.3.1: libgcc_s.so.1</p></li><li class="listitem"><p>gcc-3.3.2: libgcc_s.so.1</p></li><li class="listitem"><p>gcc-3.3.3: libgcc_s.so.1</p></li><li class="listitem"><p>gcc-3.4.x, gcc-4.[0-5].x: on m68k-linux and
hppa-linux this is either libgcc_s.so.1 (when configuring hppa-linux this is either libgcc_s.so.1 (when configuring
<code class="code">--with-sjlj-exceptions</code>) or libgcc_s.so.2. For all <code class="code">--with-sjlj-exceptions</code>) or libgcc_s.so.2. For all
others, this is libgcc_s.so.1. </p></li></ul></div></li><li><p>Symbol versioning on the libgcc_s.so binary.</p><p>It is versioned with the following labels and version others, this is libgcc_s.so.1. </p></li></ul></div></li><li class="listitem"><p>Symbol versioning on the libgcc_s.so binary.</p><p>It is versioned with the following labels and version
definitions, where the version definition is the maximum for a definitions, where the version definition is the maximum for a
particular release. Labels are cumulative. If a particular release particular release. Labels are cumulative. If a particular release
is not listed, it has the same version labels as the preceding is not listed, it has the same version labels as the preceding
release.</p><p>This corresponds to the mapfile: gcc/libgcc-std.ver</p><div class="itemizedlist"><ul type="disc"><li><p>gcc-3.0.0: GCC_3.0</p></li><li><p>gcc-3.3.0: GCC_3.3</p></li><li><p>gcc-3.3.1: GCC_3.3.1</p></li><li><p>gcc-3.3.2: GCC_3.3.2</p></li><li><p>gcc-3.3.4: GCC_3.3.4</p></li><li><p>gcc-3.4.0: GCC_3.4</p></li><li><p>gcc-3.4.2: GCC_3.4.2</p></li><li><p>gcc-3.4.4: GCC_3.4.4</p></li><li><p>gcc-4.0.0: GCC_4.0.0</p></li><li><p>gcc-4.1.0: GCC_4.1.0</p></li><li><p>gcc-4.2.0: GCC_4.2.0</p></li><li><p>gcc-4.3.0: GCC_4.3.0</p></li><li><p>gcc-4.4.0: GCC_4.4.0</p></li></ul></div></li><li><p> release.</p><p>This corresponds to the mapfile: gcc/libgcc-std.ver</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>gcc-3.0.0: GCC_3.0</p></li><li class="listitem"><p>gcc-3.3.0: GCC_3.3</p></li><li class="listitem"><p>gcc-3.3.1: GCC_3.3.1</p></li><li class="listitem"><p>gcc-3.3.2: GCC_3.3.2</p></li><li class="listitem"><p>gcc-3.3.4: GCC_3.3.4</p></li><li class="listitem"><p>gcc-3.4.0: GCC_3.4</p></li><li class="listitem"><p>gcc-3.4.2: GCC_3.4.2</p></li><li class="listitem"><p>gcc-3.4.4: GCC_3.4.4</p></li><li class="listitem"><p>gcc-4.0.0: GCC_4.0.0</p></li><li class="listitem"><p>gcc-4.1.0: GCC_4.1.0</p></li><li class="listitem"><p>gcc-4.2.0: GCC_4.2.0</p></li><li class="listitem"><p>gcc-4.3.0: GCC_4.3.0</p></li><li class="listitem"><p>gcc-4.4.0: GCC_4.4.0</p></li></ul></div></li><li class="listitem"><p>
Release versioning on the libstdc++.so binary, implemented in Release versioning on the libstdc++.so binary, implemented in
the same was as the libgcc_s.so binary above. Listed is the the same was as the libgcc_s.so binary above. Listed is the
filename: <code class="constant">DT_SONAME</code> can be deduced from filename: <code class="constant">DT_SONAME</code> can be deduced from
@ -106,7 +106,7 @@ compatible.
the table below, releases incompatible with the previous the table below, releases incompatible with the previous
one are explicitly noted. one are explicitly noted.
</p><p>It is versioned as follows: </p><p>It is versioned as follows:
</p><div class="itemizedlist"><ul type="disc"><li><p>gcc-3.0.0: libstdc++.so.3.0.0</p></li><li><p>gcc-3.0.1: libstdc++.so.3.0.1</p></li><li><p>gcc-3.0.2: libstdc++.so.3.0.2</p></li><li><p>gcc-3.0.3: libstdc++.so.3.0.2 (See Note 1)</p></li><li><p>gcc-3.0.4: libstdc++.so.3.0.4</p></li><li><p>gcc-3.1.0: libstdc++.so.4.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li><p>gcc-3.1.1: libstdc++.so.4.0.1</p></li><li><p>gcc-3.2.0: libstdc++.so.5.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li><p>gcc-3.2.1: libstdc++.so.5.0.1</p></li><li><p>gcc-3.2.2: libstdc++.so.5.0.2</p></li><li><p>gcc-3.2.3: libstdc++.so.5.0.3 (See Note 2)</p></li><li><p>gcc-3.3.0: libstdc++.so.5.0.4</p></li><li><p>gcc-3.3.1: libstdc++.so.5.0.5</p></li><li><p>gcc-3.3.2: libstdc++.so.5.0.5</p></li><li><p>gcc-3.3.3: libstdc++.so.5.0.5</p></li><li><p>gcc-3.4.0: libstdc++.so.6.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li><p>gcc-3.4.1: libstdc++.so.6.0.1</p></li><li><p>gcc-3.4.2: libstdc++.so.6.0.2</p></li><li><p>gcc-3.4.3: libstdc++.so.6.0.3</p></li><li><p>gcc-3.4.4: libstdc++.so.6.0.3</p></li><li><p>gcc-3.4.5: libstdc++.so.6.0.3</p></li><li><p>gcc-3.4.6: libstdc++.so.6.0.3</p></li><li><p>gcc-4.0.0: libstdc++.so.6.0.4</p></li><li><p>gcc-4.0.1: libstdc++.so.6.0.5</p></li><li><p>gcc-4.0.2: libstdc++.so.6.0.6</p></li><li><p>gcc-4.0.3: libstdc++.so.6.0.7</p></li><li><p>gcc-4.1.0: libstdc++.so.6.0.7</p></li><li><p>gcc-4.1.1: libstdc++.so.6.0.8</p></li><li><p>gcc-4.1.2: libstdc++.so.6.0.8</p></li><li><p>gcc-4.2.0: libstdc++.so.6.0.9</p></li><li><p>gcc-4.2.1: libstdc++.so.6.0.9 (See Note 3)</p></li><li><p>gcc-4.2.2: libstdc++.so.6.0.9</p></li><li><p>gcc-4.2.3: libstdc++.so.6.0.9</p></li><li><p>gcc-4.2.4: libstdc++.so.6.0.9</p></li><li><p>gcc-4.3.0: libstdc++.so.6.0.10</p></li><li><p>gcc-4.3.1: libstdc++.so.6.0.10</p></li><li><p>gcc-4.3.2: libstdc++.so.6.0.10</p></li><li><p>gcc-4.3.3: libstdc++.so.6.0.10</p></li><li><p>gcc-4.4.0: libstdc++.so.6.0.11</p></li></ul></div><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>gcc-3.0.0: libstdc++.so.3.0.0</p></li><li class="listitem"><p>gcc-3.0.1: libstdc++.so.3.0.1</p></li><li class="listitem"><p>gcc-3.0.2: libstdc++.so.3.0.2</p></li><li class="listitem"><p>gcc-3.0.3: libstdc++.so.3.0.2 (See Note 1)</p></li><li class="listitem"><p>gcc-3.0.4: libstdc++.so.3.0.4</p></li><li class="listitem"><p>gcc-3.1.0: libstdc++.so.4.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>gcc-3.1.1: libstdc++.so.4.0.1</p></li><li class="listitem"><p>gcc-3.2.0: libstdc++.so.5.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>gcc-3.2.1: libstdc++.so.5.0.1</p></li><li class="listitem"><p>gcc-3.2.2: libstdc++.so.5.0.2</p></li><li class="listitem"><p>gcc-3.2.3: libstdc++.so.5.0.3 (See Note 2)</p></li><li class="listitem"><p>gcc-3.3.0: libstdc++.so.5.0.4</p></li><li class="listitem"><p>gcc-3.3.1: libstdc++.so.5.0.5</p></li><li class="listitem"><p>gcc-3.3.2: libstdc++.so.5.0.5</p></li><li class="listitem"><p>gcc-3.3.3: libstdc++.so.5.0.5</p></li><li class="listitem"><p>gcc-3.4.0: libstdc++.so.6.0.0 <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li><li class="listitem"><p>gcc-3.4.1: libstdc++.so.6.0.1</p></li><li class="listitem"><p>gcc-3.4.2: libstdc++.so.6.0.2</p></li><li class="listitem"><p>gcc-3.4.3: libstdc++.so.6.0.3</p></li><li class="listitem"><p>gcc-3.4.4: libstdc++.so.6.0.3</p></li><li class="listitem"><p>gcc-3.4.5: libstdc++.so.6.0.3</p></li><li class="listitem"><p>gcc-3.4.6: libstdc++.so.6.0.3</p></li><li class="listitem"><p>gcc-4.0.0: libstdc++.so.6.0.4</p></li><li class="listitem"><p>gcc-4.0.1: libstdc++.so.6.0.5</p></li><li class="listitem"><p>gcc-4.0.2: libstdc++.so.6.0.6</p></li><li class="listitem"><p>gcc-4.0.3: libstdc++.so.6.0.7</p></li><li class="listitem"><p>gcc-4.1.0: libstdc++.so.6.0.7</p></li><li class="listitem"><p>gcc-4.1.1: libstdc++.so.6.0.8</p></li><li class="listitem"><p>gcc-4.1.2: libstdc++.so.6.0.8</p></li><li class="listitem"><p>gcc-4.2.0: libstdc++.so.6.0.9</p></li><li class="listitem"><p>gcc-4.2.1: libstdc++.so.6.0.9 (See Note 3)</p></li><li class="listitem"><p>gcc-4.2.2: libstdc++.so.6.0.9</p></li><li class="listitem"><p>gcc-4.2.3: libstdc++.so.6.0.9</p></li><li class="listitem"><p>gcc-4.2.4: libstdc++.so.6.0.9</p></li><li class="listitem"><p>gcc-4.3.0: libstdc++.so.6.0.10</p></li><li class="listitem"><p>gcc-4.3.1: libstdc++.so.6.0.10</p></li><li class="listitem"><p>gcc-4.3.2: libstdc++.so.6.0.10</p></li><li class="listitem"><p>gcc-4.3.3: libstdc++.so.6.0.10</p></li><li class="listitem"><p>gcc-4.3.4: libstdc++.so.6.0.10</p></li><li class="listitem"><p>gcc-4.4.0: libstdc++.so.6.0.11</p></li><li class="listitem"><p>gcc-4.4.1: libstdc++.so.6.0.12</p></li><li class="listitem"><p>gcc-4.4.2: libstdc++.so.6.0.13</p></li><li class="listitem"><p>gcc-4.5.0: libstdc++.so.6.0.14</p></li></ul></div><p>
Note 1: Error should be libstdc++.so.3.0.3. Note 1: Error should be libstdc++.so.3.0.3.
</p><p> </p><p>
Note 2: Not strictly required. Note 2: Not strictly required.
@ -114,7 +114,7 @@ compatible.
Note 3: This release (but not previous or subsequent) has one Note 3: This release (but not previous or subsequent) has one
known incompatibility, see <a class="ulink" href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33678" target="_top">33678</a> known incompatibility, see <a class="ulink" href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33678" target="_top">33678</a>
in the GCC bug database. in the GCC bug database.
</p></li><li><p>Symbol versioning on the libstdc++.so binary.</p><p>mapfile: libstdc++/config/linker-map.gnu</p><p>It is versioned with the following labels and version </p></li><li class="listitem"><p>Symbol versioning on the libstdc++.so binary.</p><p>mapfile: libstdc++/config/linker-map.gnu</p><p>It is versioned with the following labels and version
definitions, where the version definition is the maximum for a definitions, where the version definition is the maximum for a
particular release. Note, only symbol which are newly introduced particular release. Note, only symbol which are newly introduced
will use the maximum version definition. Thus, for release series will use the maximum version definition. Thus, for release series
@ -124,7 +124,7 @@ compatible.
GLIBCPP_3.2 for symbols that were introduced in the gcc-3.2.0 GLIBCPP_3.2 for symbols that were introduced in the gcc-3.2.0
release.) If a particular release is not listed, it has the same release.) If a particular release is not listed, it has the same
version labels as the preceding release. version labels as the preceding release.
</p><div class="itemizedlist"><ul type="disc"><li><p>gcc-3.0.0: (Error, not versioned)</p></li><li><p>gcc-3.0.1: (Error, not versioned)</p></li><li><p>gcc-3.0.2: (Error, not versioned)</p></li><li><p>gcc-3.0.3: (Error, not versioned)</p></li><li><p>gcc-3.0.4: (Error, not versioned)</p></li><li><p>gcc-3.1.0: GLIBCPP_3.1, CXXABI_1</p></li><li><p>gcc-3.1.1: GLIBCPP_3.1, CXXABI_1</p></li><li><p>gcc-3.2.0: GLIBCPP_3.2, CXXABI_1.2</p></li><li><p>gcc-3.2.1: GLIBCPP_3.2.1, CXXABI_1.2</p></li><li><p>gcc-3.2.2: GLIBCPP_3.2.2, CXXABI_1.2</p></li><li><p>gcc-3.2.3: GLIBCPP_3.2.2, CXXABI_1.2</p></li><li><p>gcc-3.3.0: GLIBCPP_3.2.2, CXXABI_1.2.1</p></li><li><p>gcc-3.3.1: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li><p>gcc-3.3.2: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li><p>gcc-3.3.3: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li><p>gcc-3.4.0: GLIBCXX_3.4, CXXABI_1.3</p></li><li><p>gcc-3.4.1: GLIBCXX_3.4.1, CXXABI_1.3</p></li><li><p>gcc-3.4.2: GLIBCXX_3.4.2</p></li><li><p>gcc-3.4.3: GLIBCXX_3.4.3</p></li><li><p>gcc-4.0.0: GLIBCXX_3.4.4, CXXABI_1.3.1</p></li><li><p>gcc-4.0.1: GLIBCXX_3.4.5</p></li><li><p>gcc-4.0.2: GLIBCXX_3.4.6</p></li><li><p>gcc-4.0.3: GLIBCXX_3.4.7</p></li><li><p>gcc-4.1.1: GLIBCXX_3.4.8</p></li><li><p>gcc-4.2.0: GLIBCXX_3.4.9</p></li><li><p>gcc-4.3.0: GLIBCXX_3.4.10, CXXABI_1.3.2</p></li><li><p>gcc-4.4.0: GLIBCXX_3.4.11, CXXABI_1.3.3</p></li></ul></div></li><li><p>Incremental bumping of a compiler pre-defined macro, </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>gcc-3.0.0: (Error, not versioned)</p></li><li class="listitem"><p>gcc-3.0.1: (Error, not versioned)</p></li><li class="listitem"><p>gcc-3.0.2: (Error, not versioned)</p></li><li class="listitem"><p>gcc-3.0.3: (Error, not versioned)</p></li><li class="listitem"><p>gcc-3.0.4: (Error, not versioned)</p></li><li class="listitem"><p>gcc-3.1.0: GLIBCPP_3.1, CXXABI_1</p></li><li class="listitem"><p>gcc-3.1.1: GLIBCPP_3.1, CXXABI_1</p></li><li class="listitem"><p>gcc-3.2.0: GLIBCPP_3.2, CXXABI_1.2</p></li><li class="listitem"><p>gcc-3.2.1: GLIBCPP_3.2.1, CXXABI_1.2</p></li><li class="listitem"><p>gcc-3.2.2: GLIBCPP_3.2.2, CXXABI_1.2</p></li><li class="listitem"><p>gcc-3.2.3: GLIBCPP_3.2.2, CXXABI_1.2</p></li><li class="listitem"><p>gcc-3.3.0: GLIBCPP_3.2.2, CXXABI_1.2.1</p></li><li class="listitem"><p>gcc-3.3.1: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li class="listitem"><p>gcc-3.3.2: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li class="listitem"><p>gcc-3.3.3: GLIBCPP_3.2.3, CXXABI_1.2.1</p></li><li class="listitem"><p>gcc-3.4.0: GLIBCXX_3.4, CXXABI_1.3</p></li><li class="listitem"><p>gcc-3.4.1: GLIBCXX_3.4.1, CXXABI_1.3</p></li><li class="listitem"><p>gcc-3.4.2: GLIBCXX_3.4.2</p></li><li class="listitem"><p>gcc-3.4.3: GLIBCXX_3.4.3</p></li><li class="listitem"><p>gcc-4.0.0: GLIBCXX_3.4.4, CXXABI_1.3.1</p></li><li class="listitem"><p>gcc-4.0.1: GLIBCXX_3.4.5</p></li><li class="listitem"><p>gcc-4.0.2: GLIBCXX_3.4.6</p></li><li class="listitem"><p>gcc-4.0.3: GLIBCXX_3.4.7</p></li><li class="listitem"><p>gcc-4.1.1: GLIBCXX_3.4.8</p></li><li class="listitem"><p>gcc-4.2.0: GLIBCXX_3.4.9</p></li><li class="listitem"><p>gcc-4.3.0: GLIBCXX_3.4.10, CXXABI_1.3.2</p></li><li class="listitem"><p>gcc-4.4.0: GLIBCXX_3.4.11, CXXABI_1.3.3</p></li><li class="listitem"><p>gcc-4.4.1: GLIBCXX_3.4.12, CXXABI_1.3.3</p></li><li class="listitem"><p>gcc-4.4.2: GLIBCXX_3.4.13, CXXABI_1.3.3</p></li><li class="listitem"><p>gcc-4.5.0: GLIBCXX_3.4.14, CXXABI_1.3.4</p></li></ul></div></li><li class="listitem"><p>Incremental bumping of a compiler pre-defined macro,
__GXX_ABI_VERSION. This macro is defined as the version of the __GXX_ABI_VERSION. This macro is defined as the version of the
compiler v3 ABI, with g++ 3.0.x being version 100. This macro will compiler v3 ABI, with g++ 3.0.x being version 100. This macro will
be automatically defined whenever g++ is used (the curious can be automatically defined whenever g++ is used (the curious can
@ -136,11 +136,11 @@ compatible.
'-fabi-version' command line option. '-fabi-version' command line option.
</p><p> </p><p>
It is versioned as follows, where 'n' is given by '-fabi-version=n': It is versioned as follows, where 'n' is given by '-fabi-version=n':
</p><div class="itemizedlist"><ul type="disc"><li><p>gcc-3.0.x: 100</p></li><li><p>gcc-3.1.x: 100 (Error, should be 101)</p></li><li><p>gcc-3.2.x: 102</p></li><li><p>gcc-3.3.x: 102</p></li><li><p>gcc-3.4.x, gcc-4.[0-3].x: 102 (when n=1)</p></li><li><p>gcc-3.4.x, gcc-4.[0-3].x: 1000 + n (when n&gt;1) </p></li><li><p>gcc-3.4.x, gcc-4.[0-3].x: 999999 (when n=0)</p></li></ul></div><p></p></li><li><p>Changes to the default compiler option for </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>gcc-3.0.x: 100</p></li><li class="listitem"><p>gcc-3.1.x: 100 (Error, should be 101)</p></li><li class="listitem"><p>gcc-3.2.x: 102</p></li><li class="listitem"><p>gcc-3.3.x: 102</p></li><li class="listitem"><p>gcc-3.4.x, gcc-4.[0-5].x: 102 (when n=1)</p></li><li class="listitem"><p>gcc-3.4.x, gcc-4.[0-5].x: 1000 + n (when n&gt;1) </p></li><li class="listitem"><p>gcc-3.4.x, gcc-4.[0-5].x: 999999 (when n=0)</p></li></ul></div><p></p></li><li class="listitem"><p>Changes to the default compiler option for
<code class="code">-fabi-version</code>. <code class="code">-fabi-version</code>.
</p><p> </p><p>
It is versioned as follows: It is versioned as follows:
</p><div class="itemizedlist"><ul type="disc"><li><p>gcc-3.0.x: (Error, not versioned) </p></li><li><p>gcc-3.1.x: (Error, not versioned) </p></li><li><p>gcc-3.2.x: <code class="code">-fabi-version=1</code></p></li><li><p>gcc-3.3.x: <code class="code">-fabi-version=1</code></p></li><li><p>gcc-3.4.x, gcc-4.[0-3].x: <code class="code">-fabi-version=2</code> <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li></ul></div><p></p></li><li><p>Incremental bumping of a library pre-defined macro. For releases </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>gcc-3.0.x: (Error, not versioned) </p></li><li class="listitem"><p>gcc-3.1.x: (Error, not versioned) </p></li><li class="listitem"><p>gcc-3.2.x: <code class="code">-fabi-version=1</code></p></li><li class="listitem"><p>gcc-3.3.x: <code class="code">-fabi-version=1</code></p></li><li class="listitem"><p>gcc-3.4.x, gcc-4.[0-5].x: <code class="code">-fabi-version=2</code> <span class="emphasis"><em>(Incompatible with previous)</em></span></p></li></ul></div><p></p></li><li class="listitem"><p>Incremental bumping of a library pre-defined macro. For releases
before 3.4.0, the macro is __GLIBCPP__. For later releases, it's before 3.4.0, the macro is __GLIBCPP__. For later releases, it's
__GLIBCXX__. (The libstdc++ project generously changed from CPP to __GLIBCXX__. (The libstdc++ project generously changed from CPP to
CXX throughout its source to allow the "C" pre-processor the CPP CXX throughout its source to allow the "C" pre-processor the CPP
@ -153,7 +153,7 @@ compatible.
the same value as gcc/DATESTAMP.) the same value as gcc/DATESTAMP.)
</p><p> </p><p>
It is versioned as follows: It is versioned as follows:
</p><div class="itemizedlist"><ul type="disc"><li><p>gcc-3.0.0: 20010615</p></li><li><p>gcc-3.0.1: 20010819</p></li><li><p>gcc-3.0.2: 20011023</p></li><li><p>gcc-3.0.3: 20011220</p></li><li><p>gcc-3.0.4: 20020220</p></li><li><p>gcc-3.1.0: 20020514</p></li><li><p>gcc-3.1.1: 20020725</p></li><li><p>gcc-3.2.0: 20020814</p></li><li><p>gcc-3.2.1: 20021119</p></li><li><p>gcc-3.2.2: 20030205</p></li><li><p>gcc-3.2.3: 20030422</p></li><li><p>gcc-3.3.0: 20030513</p></li><li><p>gcc-3.3.1: 20030804</p></li><li><p>gcc-3.3.2: 20031016</p></li><li><p>gcc-3.3.3: 20040214</p></li><li><p>gcc-3.4.0: 20040419</p></li><li><p>gcc-3.4.1: 20040701</p></li><li><p>gcc-3.4.2: 20040906</p></li><li><p>gcc-3.4.3: 20041105</p></li><li><p>gcc-3.4.4: 20050519</p></li><li><p>gcc-3.4.5: 20051201</p></li><li><p>gcc-3.4.6: 20060306</p></li><li><p>gcc-4.0.0: 20050421</p></li><li><p>gcc-4.0.1: 20050707</p></li><li><p>gcc-4.0.2: 20050921</p></li><li><p>gcc-4.0.3: 20060309</p></li><li><p>gcc-4.1.0: 20060228</p></li><li><p>gcc-4.1.1: 20060524</p></li><li><p>gcc-4.1.2: 20070214</p></li><li><p>gcc-4.2.0: 20070514</p></li><li><p>gcc-4.2.1: 20070719</p></li><li><p>gcc-4.2.2: 20071007</p></li><li><p>gcc-4.2.3: 20080201</p></li><li><p>gcc-4.2.4: 20080519</p></li><li><p>gcc-4.3.0: 20080306</p></li><li><p>gcc-4.3.1: 20080606</p></li><li><p>gcc-4.3.2: 20080827</p></li><li><p>gcc-4.3.3: 20090124</p></li><li><p>gcc-4.4.0: 20090421</p></li></ul></div><p></p></li><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>gcc-3.0.0: 20010615</p></li><li class="listitem"><p>gcc-3.0.1: 20010819</p></li><li class="listitem"><p>gcc-3.0.2: 20011023</p></li><li class="listitem"><p>gcc-3.0.3: 20011220</p></li><li class="listitem"><p>gcc-3.0.4: 20020220</p></li><li class="listitem"><p>gcc-3.1.0: 20020514</p></li><li class="listitem"><p>gcc-3.1.1: 20020725</p></li><li class="listitem"><p>gcc-3.2.0: 20020814</p></li><li class="listitem"><p>gcc-3.2.1: 20021119</p></li><li class="listitem"><p>gcc-3.2.2: 20030205</p></li><li class="listitem"><p>gcc-3.2.3: 20030422</p></li><li class="listitem"><p>gcc-3.3.0: 20030513</p></li><li class="listitem"><p>gcc-3.3.1: 20030804</p></li><li class="listitem"><p>gcc-3.3.2: 20031016</p></li><li class="listitem"><p>gcc-3.3.3: 20040214</p></li><li class="listitem"><p>gcc-3.4.0: 20040419</p></li><li class="listitem"><p>gcc-3.4.1: 20040701</p></li><li class="listitem"><p>gcc-3.4.2: 20040906</p></li><li class="listitem"><p>gcc-3.4.3: 20041105</p></li><li class="listitem"><p>gcc-3.4.4: 20050519</p></li><li class="listitem"><p>gcc-3.4.5: 20051201</p></li><li class="listitem"><p>gcc-3.4.6: 20060306</p></li><li class="listitem"><p>gcc-4.0.0: 20050421</p></li><li class="listitem"><p>gcc-4.0.1: 20050707</p></li><li class="listitem"><p>gcc-4.0.2: 20050921</p></li><li class="listitem"><p>gcc-4.0.3: 20060309</p></li><li class="listitem"><p>gcc-4.1.0: 20060228</p></li><li class="listitem"><p>gcc-4.1.1: 20060524</p></li><li class="listitem"><p>gcc-4.1.2: 20070214</p></li><li class="listitem"><p>gcc-4.2.0: 20070514</p></li><li class="listitem"><p>gcc-4.2.1: 20070719</p></li><li class="listitem"><p>gcc-4.2.2: 20071007</p></li><li class="listitem"><p>gcc-4.2.3: 20080201</p></li><li class="listitem"><p>gcc-4.2.4: 20080519</p></li><li class="listitem"><p>gcc-4.3.0: 20080306</p></li><li class="listitem"><p>gcc-4.3.1: 20080606</p></li><li class="listitem"><p>gcc-4.3.2: 20080827</p></li><li class="listitem"><p>gcc-4.3.3: 20090124</p></li><li class="listitem"><p>gcc-4.4.0: 20090421</p></li><li class="listitem"><p>gcc-4.4.1: 20090722</p></li><li class="listitem"><p>gcc-4.4.2: 20091015</p></li></ul></div><p></p></li><li class="listitem"><p>
Incremental bumping of a library pre-defined macro, Incremental bumping of a library pre-defined macro,
_GLIBCPP_VERSION. This macro is defined as the released version of _GLIBCPP_VERSION. This macro is defined as the released version of
the library, as a string literal. This is only implemented in the library, as a string literal. This is only implemented in
@ -166,7 +166,7 @@ compatible.
of config.h. of config.h.
</p><p> </p><p>
It is versioned as follows: It is versioned as follows:
</p><div class="itemizedlist"><ul type="disc"><li><p>gcc-3.0.0: "3.0.0"</p></li><li><p>gcc-3.0.1: "3.0.0" (Error, should be "3.0.1")</p></li><li><p>gcc-3.0.2: "3.0.0" (Error, should be "3.0.2")</p></li><li><p>gcc-3.0.3: "3.0.0" (Error, should be "3.0.3")</p></li><li><p>gcc-3.0.4: "3.0.0" (Error, should be "3.0.4")</p></li><li><p>gcc-3.1.0: "3.1.0"</p></li><li><p>gcc-3.1.1: "3.1.1"</p></li><li><p>gcc-3.2.0: "3.2"</p></li><li><p>gcc-3.2.1: "3.2.1"</p></li><li><p>gcc-3.2.2: "3.2.2"</p></li><li><p>gcc-3.2.3: "3.2.3"</p></li><li><p>gcc-3.3.0: "3.3"</p></li><li><p>gcc-3.3.1: "3.3.1"</p></li><li><p>gcc-3.3.2: "3.3.2"</p></li><li><p>gcc-3.3.3: "3.3.3"</p></li><li><p>gcc-3.4.x: "version-unused"</p></li><li><p>gcc-4.[0-3].x: "version-unused"</p></li></ul></div><p></p></li><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>gcc-3.0.0: "3.0.0"</p></li><li class="listitem"><p>gcc-3.0.1: "3.0.0" (Error, should be "3.0.1")</p></li><li class="listitem"><p>gcc-3.0.2: "3.0.0" (Error, should be "3.0.2")</p></li><li class="listitem"><p>gcc-3.0.3: "3.0.0" (Error, should be "3.0.3")</p></li><li class="listitem"><p>gcc-3.0.4: "3.0.0" (Error, should be "3.0.4")</p></li><li class="listitem"><p>gcc-3.1.0: "3.1.0"</p></li><li class="listitem"><p>gcc-3.1.1: "3.1.1"</p></li><li class="listitem"><p>gcc-3.2.0: "3.2"</p></li><li class="listitem"><p>gcc-3.2.1: "3.2.1"</p></li><li class="listitem"><p>gcc-3.2.2: "3.2.2"</p></li><li class="listitem"><p>gcc-3.2.3: "3.2.3"</p></li><li class="listitem"><p>gcc-3.3.0: "3.3"</p></li><li class="listitem"><p>gcc-3.3.1: "3.3.1"</p></li><li class="listitem"><p>gcc-3.3.2: "3.3.2"</p></li><li class="listitem"><p>gcc-3.3.3: "3.3.3"</p></li><li class="listitem"><p>gcc-3.4.x: "version-unused"</p></li><li class="listitem"><p>gcc-4.[0-5].x: "version-unused"</p></li></ul></div><p></p></li><li class="listitem"><p>
Matching each specific C++ compiler release to a specific set of Matching each specific C++ compiler release to a specific set of
C++ include files. This is only implemented in gcc-3.1.1 releases C++ include files. This is only implemented in gcc-3.1.1 releases
and higher. and higher.
@ -178,13 +178,13 @@ compatible.
file's macro GLIBCXX_CONFIGURE (GLIBCPP_CONFIGURE before gcc-3.4.0). file's macro GLIBCXX_CONFIGURE (GLIBCPP_CONFIGURE before gcc-3.4.0).
</p><p> </p><p>
C++ includes are versioned as follows: C++ includes are versioned as follows:
</p><div class="itemizedlist"><ul type="disc"><li><p>gcc-3.0.0: include/g++-v3</p></li><li><p>gcc-3.0.1: include/g++-v3</p></li><li><p>gcc-3.0.2: include/g++-v3</p></li><li><p>gcc-3.0.3: include/g++-v3</p></li><li><p>gcc-3.0.4: include/g++-v3</p></li><li><p>gcc-3.1.0: include/g++-v3</p></li><li><p>gcc-3.1.1: include/c++/3.1.1</p></li><li><p>gcc-3.2.0: include/c++/3.2</p></li><li><p>gcc-3.2.1: include/c++/3.2.1</p></li><li><p>gcc-3.2.2: include/c++/3.2.2</p></li><li><p>gcc-3.2.3: include/c++/3.2.3</p></li><li><p>gcc-3.3.0: include/c++/3.3</p></li><li><p>gcc-3.3.1: include/c++/3.3.1</p></li><li><p>gcc-3.3.2: include/c++/3.3.2</p></li><li><p>gcc-3.3.3: include/c++/3.3.3</p></li><li><p>gcc-3.4.0: include/c++/3.4.0</p></li><li><p>gcc-3.4.1: include/c++/3.4.1</p></li><li><p>gcc-3.4.2: include/c++/3.4.2</p></li><li><p>gcc-3.4.3: include/c++/3.4.3</p></li><li><p>gcc-3.4.4: include/c++/3.4.4</p></li><li><p>gcc-3.4.5: include/c++/3.4.5</p></li><li><p>gcc-3.4.6: include/c++/3.4.6</p></li><li><p>gcc-4.0.0: include/c++/4.0.0</p></li><li><p>gcc-4.0.1: include/c++/4.0.1</p></li><li><p>gcc-4.0.2: include/c++/4.0.2</p></li><li><p>gcc-4.0.3: include/c++/4.0.3</p></li><li><p>gcc-4.1.0: include/c++/4.1.0</p></li><li><p>gcc-4.1.1: include/c++/4.1.1</p></li><li><p>gcc-4.1.2: include/c++/4.1.2</p></li><li><p>gcc-4.2.0: include/c++/4.2.0</p></li><li><p>gcc-4.2.1: include/c++/4.2.1</p></li><li><p>gcc-4.2.2: include/c++/4.2.2</p></li><li><p>gcc-4.2.3: include/c++/4.2.3</p></li><li><p>gcc-4.2.4: include/c++/4.2.4</p></li><li><p>gcc-4.3.0: include/c++/4.3.0</p></li><li><p>gcc-4.3.1: include/c++/4.3.1</p></li><li><p>gcc-4.3.3: include/c++/4.3.3</p></li><li><p>gcc-4.4.0: include/c++/4.4.0</p></li></ul></div><p></p></li></ol></div><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>gcc-3.0.0: include/g++-v3</p></li><li class="listitem"><p>gcc-3.0.1: include/g++-v3</p></li><li class="listitem"><p>gcc-3.0.2: include/g++-v3</p></li><li class="listitem"><p>gcc-3.0.3: include/g++-v3</p></li><li class="listitem"><p>gcc-3.0.4: include/g++-v3</p></li><li class="listitem"><p>gcc-3.1.0: include/g++-v3</p></li><li class="listitem"><p>gcc-3.1.1: include/c++/3.1.1</p></li><li class="listitem"><p>gcc-3.2.0: include/c++/3.2</p></li><li class="listitem"><p>gcc-3.2.1: include/c++/3.2.1</p></li><li class="listitem"><p>gcc-3.2.2: include/c++/3.2.2</p></li><li class="listitem"><p>gcc-3.2.3: include/c++/3.2.3</p></li><li class="listitem"><p>gcc-3.3.0: include/c++/3.3</p></li><li class="listitem"><p>gcc-3.3.1: include/c++/3.3.1</p></li><li class="listitem"><p>gcc-3.3.2: include/c++/3.3.2</p></li><li class="listitem"><p>gcc-3.3.3: include/c++/3.3.3</p></li><li class="listitem"><p>gcc-3.4.0: include/c++/3.4.0</p></li><li class="listitem"><p>gcc-3.4.1: include/c++/3.4.1</p></li><li class="listitem"><p>gcc-3.4.2: include/c++/3.4.2</p></li><li class="listitem"><p>gcc-3.4.3: include/c++/3.4.3</p></li><li class="listitem"><p>gcc-3.4.4: include/c++/3.4.4</p></li><li class="listitem"><p>gcc-3.4.5: include/c++/3.4.5</p></li><li class="listitem"><p>gcc-3.4.6: include/c++/3.4.6</p></li><li class="listitem"><p>gcc-4.0.0: include/c++/4.0.0</p></li><li class="listitem"><p>gcc-4.0.1: include/c++/4.0.1</p></li><li class="listitem"><p>gcc-4.0.2: include/c++/4.0.2</p></li><li class="listitem"><p>gcc-4.0.3: include/c++/4.0.3</p></li><li class="listitem"><p>gcc-4.1.0: include/c++/4.1.0</p></li><li class="listitem"><p>gcc-4.1.1: include/c++/4.1.1</p></li><li class="listitem"><p>gcc-4.1.2: include/c++/4.1.2</p></li><li class="listitem"><p>gcc-4.2.0: include/c++/4.2.0</p></li><li class="listitem"><p>gcc-4.2.1: include/c++/4.2.1</p></li><li class="listitem"><p>gcc-4.2.2: include/c++/4.2.2</p></li><li class="listitem"><p>gcc-4.2.3: include/c++/4.2.3</p></li><li class="listitem"><p>gcc-4.2.4: include/c++/4.2.4</p></li><li class="listitem"><p>gcc-4.3.0: include/c++/4.3.0</p></li><li class="listitem"><p>gcc-4.3.1: include/c++/4.3.1</p></li><li class="listitem"><p>gcc-4.3.3: include/c++/4.3.3</p></li><li class="listitem"><p>gcc-4.3.4: include/c++/4.3.4</p></li><li class="listitem"><p>gcc-4.4.0: include/c++/4.4.0</p></li><li class="listitem"><p>gcc-4.4.1: include/c++/4.4.1</p></li><li class="listitem"><p>gcc-4.4.2: include/c++/4.4.2</p></li><li class="listitem"><p>gcc-4.5.0: include/c++/4.5.0</p></li></ul></div><p></p></li></ol></div><p>
Taken together, these techniques can accurately specify interface Taken together, these techniques can accurately specify interface
and implementation changes in the GNU C++ tools themselves. Used and implementation changes in the GNU C++ tools themselves. Used
properly, they allow both the GNU C++ tools implementation, and properly, they allow both the GNU C++ tools implementation, and
programs using them, an evolving yet controlled development that programs using them, an evolving yet controlled development that
maintains backward compatibility. maintains backward compatibility.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="abi.versioning.prereq"></a>Prerequisites</h4></div></div></div><p> </p></div><div class="sect3" title="Prerequisites"><div class="titlepage"><div><div><h4 class="title"><a id="abi.versioning.prereq"></a>Prerequisites</h4></div></div></div><p>
Minimum environment that supports a versioned ABI: A supported Minimum environment that supports a versioned ABI: A supported
dynamic linker, a GNU linker of sufficient vintage to understand dynamic linker, a GNU linker of sufficient vintage to understand
demangled C++ name globbing (ld), a shared executable compiled demangled C++ name globbing (ld), a shared executable compiled
@ -198,7 +198,7 @@ compatible.
Most modern Linux and BSD versions, particularly ones using Most modern Linux and BSD versions, particularly ones using
gcc-3.1.x tools and more recent vintages, will meet the gcc-3.1.x tools and more recent vintages, will meet the
requirements above. requirements above.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="abi.versioning.config"></a>Configuring</h4></div></div></div><p> </p></div><div class="sect3" title="Configuring"><div class="titlepage"><div><div><h4 class="title"><a id="abi.versioning.config"></a>Configuring</h4></div></div></div><p>
It turns out that most of the configure options that change It turns out that most of the configure options that change
default behavior will impact the mangled names of exported default behavior will impact the mangled names of exported
symbols, and thus impact versioning and compatibility. symbols, and thus impact versioning and compatibility.
@ -216,7 +216,7 @@ compatible.
attempts to make sure that all the requirement for symbol attempts to make sure that all the requirement for symbol
versioning are in place. For more information, please consult versioning are in place. For more information, please consult
acinclude.m4. acinclude.m4.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="abi.versioning.active"></a>Checking Active</h4></div></div></div><p> </p></div><div class="sect3" title="Checking Active"><div class="titlepage"><div><div><h4 class="title"><a id="abi.versioning.active"></a>Checking Active</h4></div></div></div><p>
When the GNU C++ library is being built with symbol versioning When the GNU C++ library is being built with symbol versioning
on, you should see the following at configure time for on, you should see the following at configure time for
libstdc++: libstdc++:
@ -252,29 +252,29 @@ If you see symbols in the resulting output with "GLIBCXX_3" as part
of the name, then the executable is versioned. Here's an example: of the name, then the executable is versioned. Here's an example:
</p><p> </p><p>
<code class="code">U _ZNSt8ios_base4InitC1Ev@@GLIBCXX_3.4</code> <code class="code">U _ZNSt8ios_base4InitC1Ev@@GLIBCXX_3.4</code>
</p></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="abi.changes_allowed"></a>Allowed Changes</h3></div></div></div><p> </p></div></div><div class="sect2" title="Allowed Changes"><div class="titlepage"><div><div><h3 class="title"><a id="abi.changes_allowed"></a>Allowed Changes</h3></div></div></div><p>
The following will cause the library minor version number to The following will cause the library minor version number to
increase, say from "libstdc++.so.3.0.4" to "libstdc++.so.3.0.5". increase, say from "libstdc++.so.3.0.4" to "libstdc++.so.3.0.5".
</p><div class="orderedlist"><ol type="1"><li><p>Adding an exported global or static data member</p></li><li><p>Adding an exported function, static or non-virtual member function</p></li><li><p>Adding an exported symbol or symbols by additional instantiations</p></li></ol></div><p> </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Adding an exported global or static data member</p></li><li class="listitem"><p>Adding an exported function, static or non-virtual member function</p></li><li class="listitem"><p>Adding an exported symbol or symbols by additional instantiations</p></li></ol></div><p>
Other allowed changes are possible. Other allowed changes are possible.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="abi.changes_no"></a>Prohibited Changes</h3></div></div></div><p> </p></div><div class="sect2" title="Prohibited Changes"><div class="titlepage"><div><div><h3 class="title"><a id="abi.changes_no"></a>Prohibited Changes</h3></div></div></div><p>
The following non-exhaustive list will cause the library major version The following non-exhaustive list will cause the library major version
number to increase, say from "libstdc++.so.3.0.4" to number to increase, say from "libstdc++.so.3.0.4" to
"libstdc++.so.4.0.0". "libstdc++.so.4.0.0".
</p><div class="orderedlist"><ol type="1"><li><p>Changes in the gcc/g++ compiler ABI</p></li><li><p>Changing size of an exported symbol</p></li><li><p>Changing alignment of an exported symbol</p></li><li><p>Changing the layout of an exported symbol</p></li><li><p>Changing mangling on an exported symbol</p></li><li><p>Deleting an exported symbol</p></li><li><p>Changing the inheritance properties of a type by adding or removing </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Changes in the gcc/g++ compiler ABI</p></li><li class="listitem"><p>Changing size of an exported symbol</p></li><li class="listitem"><p>Changing alignment of an exported symbol</p></li><li class="listitem"><p>Changing the layout of an exported symbol</p></li><li class="listitem"><p>Changing mangling on an exported symbol</p></li><li class="listitem"><p>Deleting an exported symbol</p></li><li class="listitem"><p>Changing the inheritance properties of a type by adding or removing
base classes</p></li><li><p> base classes</p></li><li class="listitem"><p>
Changing the size, alignment, or layout of types Changing the size, alignment, or layout of types
specified in the C++ standard. These may not necessarily be specified in the C++ standard. These may not necessarily be
instantiated or otherwise exported in the library binary, and instantiated or otherwise exported in the library binary, and
include all the required locale facets, as well as things like include all the required locale facets, as well as things like
std::basic_streambuf, et al. std::basic_streambuf, et al.
</p></li><li><p> Adding an explicit copy constructor or destructor to a </p></li><li class="listitem"><p> Adding an explicit copy constructor or destructor to a
class that would otherwise have implicit versions. This will change class that would otherwise have implicit versions. This will change
the way the compiler deals with this class in by-value return the way the compiler deals with this class in by-value return
statements or parameters: instead of being passing instances of this statements or parameters: instead of being passing instances of this
class in registers, the compiler will be forced to use memory. See <a class="ulink" href="http://www.codesourcery.com/cxx-abi/abi.html#calls" target="_top"> this part</a> class in registers, the compiler will be forced to use memory. See <a class="ulink" href="http://www.codesourcery.com/cxx-abi/abi.html#calls" target="_top"> this part</a>
of the C++ ABI documentation for further details. of the C++ ABI documentation for further details.
</p></li></ol></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="abi.impl"></a>Implementation</h3></div></div></div><div class="orderedlist"><ol type="1"><li><p> </p></li></ol></div></div><div class="sect2" title="Implementation"><div class="titlepage"><div><div><h3 class="title"><a id="abi.impl"></a>Implementation</h3></div></div></div><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
Separation of interface and implementation Separation of interface and implementation
</p><p> </p><p>
This is accomplished by two techniques that separate the API from This is accomplished by two techniques that separate the API from
@ -301,7 +301,7 @@ class in registers, the compiler will be forced to use memory. See <a class="uli
</p></dd></dl></div><p> </p></dd></dl></div><p>
In addition, these techniques have the additional benefit that they In addition, these techniques have the additional benefit that they
reduce binary size, which can increase runtime performance. reduce binary size, which can increase runtime performance.
</p></li><li><p> </p></li><li class="listitem"><p>
Namespaces linking symbol definitions to export mapfiles Namespaces linking symbol definitions to export mapfiles
</p><p> </p><p>
All symbols in the shared library binary are processed by a All symbols in the shared library binary are processed by a
@ -320,9 +320,9 @@ class in registers, the compiler will be forced to use memory. See <a class="uli
exceptional symbols are allowed to be visible.</p></dd><dt><span class="term"><code class="code">namespace __gnu_cxx</code></span></dt><dd><p> Defaults to not exporting any symbols in label exceptional symbols are allowed to be visible.</p></dd><dt><span class="term"><code class="code">namespace __gnu_cxx</code></span></dt><dd><p> Defaults to not exporting any symbols in label
<code class="code">GLIBCXX</code>, select items are allowed to be visible.</p></dd><dt><span class="term"><code class="code">namespace __gnu_internal</code></span></dt><dd><p> Defaults to not exported, no items are allowed to be visible.</p></dd><dt><span class="term"><code class="code">namespace __cxxabiv1</code>, aliased to <code class="code"> namespace abi</code></span></dt><dd><p> Defaults to not exporting any symbols in label <code class="code">GLIBCXX</code>, select items are allowed to be visible.</p></dd><dt><span class="term"><code class="code">namespace __gnu_internal</code></span></dt><dd><p> Defaults to not exported, no items are allowed to be visible.</p></dd><dt><span class="term"><code class="code">namespace __cxxabiv1</code>, aliased to <code class="code"> namespace abi</code></span></dt><dd><p> Defaults to not exporting any symbols in label
<code class="code">CXXABI</code>, select items are allowed to be visible.</p></dd></dl></div><p> <code class="code">CXXABI</code>, select items are allowed to be visible.</p></dd></dl></div><p>
</p></li><li><p>Freezing the API</p><p>Disallowed changes, as above, are not made on a stable release </p></li><li class="listitem"><p>Freezing the API</p><p>Disallowed changes, as above, are not made on a stable release
branch. Enforcement tends to be less strict with GNU extensions that branch. Enforcement tends to be less strict with GNU extensions that
standard includes.</p></li></ol></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="abi.testing"></a>Testing</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="abi.testing.single"></a>Single ABI Testing</h4></div></div></div><p> standard includes.</p></li></ol></div></div><div class="sect2" title="Testing"><div class="titlepage"><div><div><h3 class="title"><a id="abi.testing"></a>Testing</h3></div></div></div><div class="sect3" title="Single ABI Testing"><div class="titlepage"><div><div><h4 class="title"><a id="abi.testing.single"></a>Single ABI Testing</h4></div></div></div><p>
Testing for GNU C++ ABI changes is composed of two distinct Testing for GNU C++ ABI changes is composed of two distinct
areas: testing the C++ compiler (g++) for compiler changes, and areas: testing the C++ compiler (g++) for compiler changes, and
testing the C++ library (libstdc++) for library changes. testing the C++ library (libstdc++) for library changes.
@ -388,7 +388,7 @@ and other detailed data is not displayed with this flag.
</p><p> </p><p>
Perhaps there are other C++ ABI checkers. If so, please notify Perhaps there are other C++ ABI checkers. If so, please notify
us. We'd like to know about them! us. We'd like to know about them!
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="abi.testing.multi"></a>Multiple ABI Testing</h4></div></div></div><p> </p></div><div class="sect3" title="Multiple ABI Testing"><div class="titlepage"><div><div><h4 class="title"><a id="abi.testing.multi"></a>Multiple ABI Testing</h4></div></div></div><p>
A "C" application, dynamically linked to two shared libraries, liba, A "C" application, dynamically linked to two shared libraries, liba,
libb. The dependent library liba is C++ shared library compiled with libb. The dependent library liba is C++ shared library compiled with
gcc-3.3.x, and uses io, exceptions, locale, etc. The dependent library gcc-3.3.x, and uses io, exceptions, locale, etc. The dependent library
@ -451,7 +451,7 @@ gcc test.c -g -O2 -L. -lone -ltwo /usr/lib/libstdc++.so.5 /usr/lib/libstdc++.so.
This resulting binary, when executed, will be able to safely use This resulting binary, when executed, will be able to safely use
code from both liba, and the dependent libstdc++.so.6, and libb, code from both liba, and the dependent libstdc++.so.6, and libb,
with the dependent libstdc++.so.5. with the dependent libstdc++.so.5.
</p></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="abi.issues"></a>Outstanding Issues</h3></div></div></div><p> </p></div></div><div class="sect2" title="Outstanding Issues"><div class="titlepage"><div><div><h3 class="title"><a id="abi.issues"></a>Outstanding Issues</h3></div></div></div><p>
Some features in the C++ language make versioning especially Some features in the C++ language make versioning especially
difficult. In particular, compiler generated constructs such as difficult. In particular, compiler generated constructs such as
implicit instantiations for templates, typeinfo information, and implicit instantiations for templates, typeinfo information, and
@ -464,56 +464,56 @@ gcc test.c -g -O2 -L. -lone -ltwo /usr/lib/libstdc++.so.5 /usr/lib/libstdc++.so.
<a class="ulink" href="http://gcc.gnu.org/PR24660" target="_top">24660: versioning weak symbols in libstdc++</a> <a class="ulink" href="http://gcc.gnu.org/PR24660" target="_top">24660: versioning weak symbols in libstdc++</a>
</p><p> </p><p>
<a class="ulink" href="http://gcc.gnu.org/PR19664" target="_top">19664: libstdc++ headers should have pop/push of the visibility around the declarations</a> <a class="ulink" href="http://gcc.gnu.org/PR19664" target="_top">19664: libstdc++ headers should have pop/push of the visibility around the declarations</a>
</p></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="abi.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id658186"></a><p><span class="title"><i> </p></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="abi.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry" title="ABIcheck, a vague idea of checking ABI compatibility"><a id="id442262"></a><p><span class="title"><i>
ABIcheck, a vague idea of checking ABI compatibility ABIcheck, a vague idea of checking ABI compatibility
</i>. </span><span class="biblioid"> </i>. </span><span class="biblioid">
<a class="ulink" href="http://abicheck.sourceforge.net/" target="_top"> <a class="ulink" href="http://abicheck.sourceforge.net/" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id658203"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="C++ ABI Reference"><a id="id442280"></a><p><span class="title"><i>
C++ ABI Reference C++ ABI Reference
</i>. </span><span class="biblioid"> </i>. </span><span class="biblioid">
<a class="ulink" href="http://www.codesourcery.com/public/cxx-abi/" target="_top"> <a class="ulink" href="http://www.codesourcery.com/public/cxx-abi/" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id658220"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="Intel® Compilers for Linux* -Compatibility with the GNU Compilers"><a id="id442297"></a><p><span class="title"><i>
Intel® Compilers for Linux* -Compatibility with the GNU Compilers Intel® Compilers for Linux* -Compatibility with the GNU Compilers
</i>. </span><span class="biblioid"> </i>. </span><span class="biblioid">
<a class="ulink" href="http://www.intel.com/cd/software/products/asmo-na/eng/284736.htm" target="_top"> <a class="ulink" href="http://www.intel.com/cd/software/products/asmo-na/eng/284736.htm" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id658238"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="Sun Solaris 2.9 : Linker and Libraries Guide (document 816-1386)"><a id="id442314"></a><p><span class="title"><i>
Sun Solaris 2.9 : Linker and Libraries Guide (document 816-1386) Sun Solaris 2.9 : Linker and Libraries Guide (document 816-1386)
</i>. </span><span class="biblioid"> </i>. </span><span class="biblioid">
<a class="ulink" href="http://docs.sun.com/app/docs/doc/817-1984" target="_top"> <a class="ulink" href="http://docs.sun.com/app/docs/doc/817-1984" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id658254"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="Sun Solaris 2.9 : C++ Migration Guide (document 816-2459)"><a id="id442331"></a><p><span class="title"><i>
Sun Solaris 2.9 : C++ Migration Guide (document 816-2459) Sun Solaris 2.9 : C++ Migration Guide (document 816-2459)
</i>. </span><span class="biblioid"> </i>. </span><span class="biblioid">
<a class="ulink" href="http://docs.sun.com/app/docs/doc/819-5266" target="_top"> <a class="ulink" href="http://docs.sun.com/app/docs/doc/819-5266" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id658272"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="How to Write Shared Libraries"><a id="id442348"></a><p><span class="title"><i>
How to Write Shared Libraries How to Write Shared Libraries
</i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="biblioid"> </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="biblioid">
<a class="ulink" href="http://people.redhat.com/drepper/dsohowto.pdf" target="_top"> <a class="ulink" href="http://people.redhat.com/drepper/dsohowto.pdf" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id675905"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="C++ ABI for the ARM Architecture"><a id="id442376"></a><p><span class="title"><i>
C++ ABI for the ARM Architecture C++ ABI for the ARM Architecture
</i>. </span><span class="biblioid"> </i>. </span><span class="biblioid">
<a class="ulink" href="http://www.arm.com/miscPDFs/8033.pdf" target="_top"> <a class="ulink" href="http://www.arm.com/miscPDFs/8033.pdf" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id675922"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="Dynamic Shared Objects: Survey and Issues"><a id="id442393"></a><p><span class="title"><i>
Dynamic Shared Objects: Survey and Issues Dynamic Shared Objects: Survey and Issues
</i>. </span><span class="subtitle"> </i>. </span><span class="subtitle">
ISO C++ J16/06-0046 ISO C++ J16/06-0046
. </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span><span class="biblioid"> . </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span><span class="biblioid">
<a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1976.html" target="_top"> <a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1976.html" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id675954"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="Versioning With Namespaces"><a id="id461984"></a><p><span class="title"><i>
Versioning With Namespaces Versioning With Namespaces
</i>. </span><span class="subtitle"> </i>. </span><span class="subtitle">
ISO C++ J16/06-0083 ISO C++ J16/06-0083
. </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span><span class="biblioid"> . </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span><span class="biblioid">
<a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2013.html" target="_top"> <a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2013.html" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id675987"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="Binary Compatibility of Shared Libraries Implemented in C++ on GNU/Linux Systems"><a id="id462017"></a><p><span class="title"><i>
Binary Compatibility of Shared Libraries Implemented in C++ on GNU/Linux Systems Binary Compatibility of Shared Libraries Implemented in C++ on GNU/Linux Systems
</i>. </span><span class="subtitle"> </i>. </span><span class="subtitle">
SYRCoSE 2009 SYRCoSE 2009

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part IX.  Algorithms</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; , &#10; algorithm&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="bk01pt08ch19s02.html" title="One Past the End" /><link rel="next" href="bk01pt09pr02.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part IX.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part IX.  Algorithms</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; , &#10; algorithm&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="bk01pt08ch19s02.html" title="One Past the End" /><link rel="next" href="bk01pt09pr02.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part IX. 
Algorithms Algorithms
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt08ch19s02.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt09pr02.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.algorithms"></a>Part IX.  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt08ch19s02.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt09pr02.html">Next</a></td></tr></table><hr /></div><div class="part" title="Part IX.  Algorithms"><div class="titlepage"><div><div><h1 class="title"><a id="manual.algorithms"></a>Part IX. 
Algorithms Algorithms
<a id="id721514" class="indexterm"></a> <a id="id455873" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="preface"><a href="bk01pt09pr02.html"></a></span></dt><dt><span class="chapter"><a href="bk01pt09ch20.html">20. Mutating</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt09ch20.html#algorithms.mutating.swap">swap</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt09ch20.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt08ch19s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt09pr02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">One Past the End </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html> </h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="preface"><a href="bk01pt09pr02.html"></a></span></dt><dt><span class="chapter"><a href="bk01pt09ch20.html">20. Mutating</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt09ch20.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt09ch20.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt08ch19s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt09pr02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">One Past the End </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>API Evolution and Deprecation History</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="ISO C++, api, evolution, deprecation, history" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="abi.html" title="ABI Policy and Guidelines" /><link rel="next" href="backwards.html" title="Backwards Compatibility" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">API Evolution and Deprecation History</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="abi.html">Prev</a> </td><th width="60%" align="center">Appendix B.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>API Evolution and Deprecation History</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="ISO C++, api, evolution, deprecation, history" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="abi.html" title="ABI Policy and Guidelines" /><link rel="next" href="backwards.html" title="Backwards Compatibility" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">API Evolution and Deprecation History</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="abi.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance Porting and Maintenance
</th><td width="20%" align="right"> <a accesskey="n" href="backwards.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appendix.porting.api"></a>API Evolution and Deprecation History</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="backwards.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="API Evolution and Deprecation History"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appendix.porting.api"></a>API Evolution and Deprecation History</h2></div></div></div><p>
A list of user-visible changes, in chronological order A list of user-visible changes, in chronological order
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_300"></a><code class="constant">3.0</code></h3></div></div></div><p> </p><div class="sect2" title="3.0"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_300"></a><code class="constant">3.0</code></h3></div></div></div><p>
Extensions moved to <code class="filename">include/ext</code>. Extensions moved to <code class="filename">include/ext</code>.
</p><p> </p><p>
Include files from the SGI/HP sources that pre-date the ISO standard Include files from the SGI/HP sources that pre-date the ISO standard
@ -14,7 +14,7 @@ the <code class="filename">include/backward</code> directory and a deprecated wa
is added that notifies on inclusion (<code class="literal">-Wno-deprecated</code> is added that notifies on inclusion (<code class="literal">-Wno-deprecated</code>
deactivates the warning.) deactivates the warning.)
</p><p>Deprecated include <code class="filename">backward/strstream</code> added.</p><p>Removal of include <code class="filename">builtinbuf.h</code>, <code class="filename">indstream.h</code>, <code class="filename">parsestream.h</code>, <code class="filename">PlotFile.h</code>, <code class="filename">SFile.h</code>, <code class="filename">stdiostream.h</code>, and <code class="filename">stream.h</code>. </p><p>Deprecated include <code class="filename">backward/strstream</code> added.</p><p>Removal of include <code class="filename">builtinbuf.h</code>, <code class="filename">indstream.h</code>, <code class="filename">parsestream.h</code>, <code class="filename">PlotFile.h</code>, <code class="filename">SFile.h</code>, <code class="filename">stdiostream.h</code>, and <code class="filename">stream.h</code>.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_310"></a><code class="constant">3.1</code></h3></div></div></div><p> </p></div><div class="sect2" title="3.1"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_310"></a><code class="constant">3.1</code></h3></div></div></div><p>
</p><p> </p><p>
Extensions from SGI/HP moved from <code class="code">namespace std</code> Extensions from SGI/HP moved from <code class="code">namespace std</code>
to <code class="code">namespace __gnu_cxx</code>. As part of this, the following to <code class="code">namespace __gnu_cxx</code>. As part of this, the following
@ -26,15 +26,15 @@ Extensions to <code class="code">basic_filebuf</code> introduced: <code class="c
Extensions to tree data structures added in <code class="filename">ext/rb_tree</code>. Extensions to tree data structures added in <code class="filename">ext/rb_tree</code>.
</p><p> </p><p>
Removal of <code class="filename">ext/tree</code>, moved to <code class="filename">backward/tree.h</code>. Removal of <code class="filename">ext/tree</code>, moved to <code class="filename">backward/tree.h</code>.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_320"></a><code class="constant">3.2</code></h3></div></div></div><p> </p></div><div class="sect2" title="3.2"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_320"></a><code class="constant">3.2</code></h3></div></div></div><p>
</p><p>Symbol versioning introduced for shared library.</p><p>Removal of include <code class="filename">backward/strstream.h</code>.</p><p>Allocator changes. Change <code class="code">__malloc_alloc</code> to <code class="code">malloc_allocator</code> and <code class="code">__new_alloc</code> to <code class="code">new_allocator</code>. </p><p> For GCC releases from 2.95 through the 3.1 series, defining </p><p>Symbol versioning introduced for shared library.</p><p>Removal of include <code class="filename">backward/strstream.h</code>.</p><p>Allocator changes. Change <code class="code">__malloc_alloc</code> to <code class="code">malloc_allocator</code> and <code class="code">__new_alloc</code> to <code class="code">new_allocator</code>. </p><p> For GCC releases from 2.95 through the 3.1 series, defining
<code class="literal">__USE_MALLOC</code> on the gcc command line would change the <code class="literal">__USE_MALLOC</code> on the gcc command line would change the
default allocation strategy to instead use <code class="code"> malloc</code> and default allocation strategy to instead use <code class="code"> malloc</code> and
<code class="function">free</code>. (This same functionality is now spelled <code class="literal">_GLIBCXX_FORCE_NEW</code>, see <code class="function">free</code>. (This same functionality is now spelled <code class="literal">_GLIBCXX_FORCE_NEW</code>, see
<a class="link" href="using_macros.html" title="Macros">this page</a> <a class="link" href="using_macros.html" title="Macros">this page</a>
for details. for details.
</p><p>Error handling in iostreams cleaned up, made consistent. </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_330"></a><code class="constant">3.3</code></h3></div></div></div><p> </p><p>Error handling in iostreams cleaned up, made consistent. </p></div><div class="sect2" title="3.3"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_330"></a><code class="constant">3.3</code></h3></div></div></div><p>
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_340"></a><code class="constant">3.4</code></h3></div></div></div><p> </p></div><div class="sect2" title="3.4"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_340"></a><code class="constant">3.4</code></h3></div></div></div><p>
</p><p> </p><p>
Large file support. Large file support.
</p><p> Extensions for generic characters and <code class="code">char_traits</code> added in <code class="filename">ext/pod_char_traits.h</code>. </p><p> Extensions for generic characters and <code class="code">char_traits</code> added in <code class="filename">ext/pod_char_traits.h</code>.
@ -75,11 +75,11 @@ _Alloc_traits</code> have been removed.
<span class="type">__alloc</span> to select an underlying allocator that <span class="type">__alloc</span> to select an underlying allocator that
satisfied memory allocation requests. The selection of this satisfied memory allocation requests. The selection of this
underlying allocator was not user-configurable. underlying allocator was not user-configurable.
</p><div class="table"><a id="id623096"></a><p class="title"><b>Table B.1. Extension Allocators</b></p><div class="table-contents"><table summary="Extension Allocators" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Allocator (3.4)</th><th align="left">Header (3.4)</th><th align="left">Allocator (3.[0-3])</th><th align="left">Header (3.[0-3])</th></tr></thead><tbody><tr><td align="left"><code class="classname">__gnu_cxx::new_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/new_allocator.h</code></td><td align="left"><code class="classname">std::__new_alloc</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::malloc_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/malloc_allocator.h</code></td><td align="left"><code class="classname">std::__malloc_alloc_template&lt;int&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::debug_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/debug_allocator.h</code></td><td align="left"><code class="classname">std::debug_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__pool_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">ext/pool_allocator.h</code></td><td align="left"><code class="classname">std::__default_alloc_template&lt;bool,int&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__mt_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">ext/mt_allocator.h</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><code class="classname">__gnu_cxx::bitmap_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/bitmap_allocator.h</code></td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /><p> Releases after gcc-3.4 have continued to add to the collection </p><div class="table"><a id="id516151"></a><p class="title"><b>Table B.1. Extension Allocators</b></p><div class="table-contents"><table summary="Extension Allocators" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Allocator (3.4)</th><th align="left">Header (3.4)</th><th align="left">Allocator (3.[0-3])</th><th align="left">Header (3.[0-3])</th></tr></thead><tbody><tr><td align="left"><code class="classname">__gnu_cxx::new_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/new_allocator.h</code></td><td align="left"><code class="classname">std::__new_alloc</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::malloc_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/malloc_allocator.h</code></td><td align="left"><code class="classname">std::__malloc_alloc_template&lt;int&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::debug_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/debug_allocator.h</code></td><td align="left"><code class="classname">std::debug_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__pool_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">ext/pool_allocator.h</code></td><td align="left"><code class="classname">std::__default_alloc_template&lt;bool,int&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__mt_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">ext/mt_allocator.h</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><code class="classname">__gnu_cxx::bitmap_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/bitmap_allocator.h</code></td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /><p> Releases after gcc-3.4 have continued to add to the collection
of available allocators. All of these new allocators are of available allocators. All of these new allocators are
standard-style. The following table includes details, along with standard-style. The following table includes details, along with
the first released version of GCC that included the extension allocator. the first released version of GCC that included the extension allocator.
</p><div class="table"><a id="id721371"></a><p class="title"><b>Table B.2. Extension Allocators Continued</b></p><div class="table-contents"><table summary="Extension Allocators Continued" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Allocator</th><th align="left">Include</th><th align="left">Version</th></tr></thead><tbody><tr><td align="left"><code class="classname">__gnu_cxx::array_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/array_allocator.h</code></td><td align="left">4.0.0</td></tr><tr><td align="left"><code class="classname">__gnu_cxx::throw_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/throw_allocator.h</code></td><td align="left">4.2.0</td></tr></tbody></table></div></div><br class="table-break" /><p> </p><div class="table"><a id="id535166"></a><p class="title"><b>Table B.2. Extension Allocators Continued</b></p><div class="table-contents"><table summary="Extension Allocators Continued" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Allocator</th><th align="left">Include</th><th align="left">Version</th></tr></thead><tbody><tr><td align="left"><code class="classname">__gnu_cxx::array_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/array_allocator.h</code></td><td align="left">4.0.0</td></tr><tr><td align="left"><code class="classname">__gnu_cxx::throw_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/throw_allocator.h</code></td><td align="left">4.2.0</td></tr></tbody></table></div></div><br class="table-break" /><p>
Debug mode first appears. Debug mode first appears.
</p><p> </p><p>
Precompiled header support <acronym class="acronym">PCH</acronym> support. Precompiled header support <acronym class="acronym">PCH</acronym> support.
@ -89,7 +89,7 @@ Macro guard for changed, from <code class="literal">_GLIBCPP_</code> to <code cl
Extension <code class="filename">ext/stdio_sync_filebuf.h</code> added. Extension <code class="filename">ext/stdio_sync_filebuf.h</code> added.
</p><p> </p><p>
Extension <code class="filename">ext/demangle.h</code> added. Extension <code class="filename">ext/demangle.h</code> added.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_400"></a><code class="constant">4.0</code></h3></div></div></div><p> </p></div><div class="sect2" title="4.0"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_400"></a><code class="constant">4.0</code></h3></div></div></div><p>
</p><p> </p><p>
TR1 features first appear. TR1 features first appear.
</p><p> </p><p>
@ -98,14 +98,14 @@ Extension allocator <code class="filename">ext/array_allocator.h</code> added.
Extension <code class="code">codecvt</code> specializations moved to <code class="filename">ext/codecvt_specializations.h</code>. Extension <code class="code">codecvt</code> specializations moved to <code class="filename">ext/codecvt_specializations.h</code>.
</p><p> </p><p>
Removal of <code class="filename">ext/demangle.h</code>. Removal of <code class="filename">ext/demangle.h</code>.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_410"></a><code class="constant">4.1</code></h3></div></div></div><p> </p></div><div class="sect2" title="4.1"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_410"></a><code class="constant">4.1</code></h3></div></div></div><p>
</p><p> </p><p>
Removal of <code class="filename">cassert</code> from all standard headers: now has to be explicitly included for <code class="code">std::assert</code> calls. Removal of <code class="filename">cassert</code> from all standard headers: now has to be explicitly included for <code class="code">std::assert</code> calls.
</p><p> Extensions for policy-based data structures first added. New includes, </p><p> Extensions for policy-based data structures first added. New includes,
types, namespace <code class="code">pb_assoc</code>. types, namespace <code class="code">pb_assoc</code>.
</p><p> Extensions for typelists added in <code class="filename">ext/typelist.h</code>. </p><p> Extensions for typelists added in <code class="filename">ext/typelist.h</code>.
</p><p> Extension for policy-based <code class="code">basic_string</code> first added: <code class="code">__gnu_cxx::__versa_string</code> in <code class="filename">ext/vstring.h</code>. </p><p> Extension for policy-based <code class="code">basic_string</code> first added: <code class="code">__gnu_cxx::__versa_string</code> in <code class="filename">ext/vstring.h</code>.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_420"></a><code class="constant">4.2</code></h3></div></div></div><p> </p></div><div class="sect2" title="4.2"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_420"></a><code class="constant">4.2</code></h3></div></div></div><p>
</p><p> Default visibility attributes applied to <code class="code">namespace std</code>. Support for <code class="code">-fvisibility</code>. </p><p> Default visibility attributes applied to <code class="code">namespace std</code>. Support for <code class="code">-fvisibility</code>.
</p><p>TR1 <code class="filename">random</code>, <code class="filename">complex</code>, and C compatibility headers added.</p><p> Extensions for concurrent programming consolidated </p><p>TR1 <code class="filename">random</code>, <code class="filename">complex</code>, and C compatibility headers added.</p><p> Extensions for concurrent programming consolidated
into <code class="filename">ext/concurrence.h</code> and <code class="filename">ext/atomicity.h</code>, into <code class="filename">ext/concurrence.h</code> and <code class="filename">ext/atomicity.h</code>,
@ -120,24 +120,25 @@ types, namespace moved to <code class="code">__pb_ds</code>.
std::__debug</code> and extensions in <code class="code">namespace std::__debug</code> and extensions in <code class="code">namespace
__gnu_cxx::__debug</code>.</p><p> Extensions added: <code class="filename">ext/typelist.h</code> __gnu_cxx::__debug</code>.</p><p> Extensions added: <code class="filename">ext/typelist.h</code>
and <code class="filename">ext/throw_allocator.h</code>. and <code class="filename">ext/throw_allocator.h</code>.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_430"></a><code class="constant">4.3</code></h3></div></div></div><p> </p></div><div class="sect2" title="4.3"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_430"></a><code class="constant">4.3</code></h3></div></div></div><p>
</p><p> </p><p>
C++0X features first appear. C++0X features first appear.
</p><p>TR1 <code class="filename">regex</code> and <code class="filename">cmath</code>'s mathematical special function added.</p><p> </p><p>TR1 <code class="filename">regex</code> and <code class="filename">cmath</code>'s mathematical special function added.
</p><p>
Backward include edit. Backward include edit.
</p><div class="itemizedlist"><ul type="disc"><li><p>Removed</p><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Removed</p><p>
<code class="filename">algobase.h</code> <code class="filename">algo.h</code> <code class="filename">alloc.h</code> <code class="filename">bvector.h</code> <code class="filename">complex.h</code> <code class="filename">algobase.h</code> <code class="filename">algo.h</code> <code class="filename">alloc.h</code> <code class="filename">bvector.h</code> <code class="filename">complex.h</code>
<code class="filename">defalloc.h</code> <code class="filename">deque.h</code> <code class="filename">fstream.h</code> <code class="filename">function.h</code> <code class="filename">hash_map.h</code> <code class="filename">hash_set.h</code> <code class="filename">defalloc.h</code> <code class="filename">deque.h</code> <code class="filename">fstream.h</code> <code class="filename">function.h</code> <code class="filename">hash_map.h</code> <code class="filename">hash_set.h</code>
<code class="filename">hashtable.h</code> <code class="filename">heap.h</code> <code class="filename">iomanip.h</code> <code class="filename">iostream.h</code> <code class="filename">istream.h</code> <code class="filename">iterator.h</code> <code class="filename">hashtable.h</code> <code class="filename">heap.h</code> <code class="filename">iomanip.h</code> <code class="filename">iostream.h</code> <code class="filename">istream.h</code> <code class="filename">iterator.h</code>
<code class="filename">list.h</code> <code class="filename">map.h</code> <code class="filename">multimap.h</code> <code class="filename">multiset.h</code> <code class="filename">new.h</code> <code class="filename">ostream.h</code> <code class="filename">pair.h</code> <code class="filename">queue.h</code> <code class="filename">rope.h</code> <code class="filename">set.h</code> <code class="filename">slist.h</code> <code class="filename">stack.h</code> <code class="filename">streambuf.h</code> <code class="filename">stream.h</code> <code class="filename">tempbuf.h</code> <code class="filename">list.h</code> <code class="filename">map.h</code> <code class="filename">multimap.h</code> <code class="filename">multiset.h</code> <code class="filename">new.h</code> <code class="filename">ostream.h</code> <code class="filename">pair.h</code> <code class="filename">queue.h</code> <code class="filename">rope.h</code> <code class="filename">set.h</code> <code class="filename">slist.h</code> <code class="filename">stack.h</code> <code class="filename">streambuf.h</code> <code class="filename">stream.h</code> <code class="filename">tempbuf.h</code>
<code class="filename">tree.h</code> <code class="filename">vector.h</code> <code class="filename">tree.h</code> <code class="filename">vector.h</code>
</p></li><li><p>Added</p><p> </p></li><li class="listitem"><p>Added</p><p>
<code class="filename">hash_map</code> and <code class="filename">hash_set</code> <code class="filename">hash_map</code> and <code class="filename">hash_set</code>
</p></li><li><p>Added in C++0x</p><p> </p></li><li class="listitem"><p>Added in C++0x</p><p>
<code class="filename">auto_ptr.h</code> and <code class="filename">binders.h</code> <code class="filename">auto_ptr.h</code> and <code class="filename">binders.h</code>
</p></li></ul></div><p> </p></li></ul></div><p>
Header dependency streamlining. Header dependency streamlining.
</p><div class="itemizedlist"><ul type="disc"><li><p><code class="filename">algorithm</code> no longer includes <code class="filename">climits</code>, <code class="filename">cstring</code>, or <code class="filename">iosfwd</code> </p></li><li><p><code class="filename">bitset</code> no longer includes <code class="filename">istream</code> or <code class="filename">ostream</code>, adds <code class="filename">iosfwd</code> </p></li><li><p><code class="filename">functional</code> no longer includes <code class="filename">cstddef</code></p></li><li><p><code class="filename">iomanip</code> no longer includes <code class="filename">istream</code>, <code class="filename">istream</code>, or <code class="filename">functional</code>, adds <code class="filename">ioswd</code> </p></li><li><p><code class="filename">numeric</code> no longer includes <code class="filename">iterator</code></p></li><li><p><code class="filename">string</code> no longer includes <code class="filename">algorithm</code> or <code class="filename">memory</code></p></li><li><p><code class="filename">valarray</code> no longer includes <code class="filename">numeric</code> or <code class="filename">cstdlib</code></p></li><li><p><code class="filename">tr1/hashtable</code> no longer includes <code class="filename">memory</code> or <code class="filename">functional</code></p></li><li><p><code class="filename">tr1/memory</code> no longer includes <code class="filename">algorithm</code></p></li><li><p><code class="filename">tr1/random</code> no longer includes <code class="filename">algorithm</code> or <code class="filename">fstream</code></p></li></ul></div><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><code class="filename">algorithm</code> no longer includes <code class="filename">climits</code>, <code class="filename">cstring</code>, or <code class="filename">iosfwd</code> </p></li><li class="listitem"><p><code class="filename">bitset</code> no longer includes <code class="filename">istream</code> or <code class="filename">ostream</code>, adds <code class="filename">iosfwd</code> </p></li><li class="listitem"><p><code class="filename">functional</code> no longer includes <code class="filename">cstddef</code></p></li><li class="listitem"><p><code class="filename">iomanip</code> no longer includes <code class="filename">istream</code>, <code class="filename">istream</code>, or <code class="filename">functional</code>, adds <code class="filename">ioswd</code> </p></li><li class="listitem"><p><code class="filename">numeric</code> no longer includes <code class="filename">iterator</code></p></li><li class="listitem"><p><code class="filename">string</code> no longer includes <code class="filename">algorithm</code> or <code class="filename">memory</code></p></li><li class="listitem"><p><code class="filename">valarray</code> no longer includes <code class="filename">numeric</code> or <code class="filename">cstdlib</code></p></li><li class="listitem"><p><code class="filename">tr1/hashtable</code> no longer includes <code class="filename">memory</code> or <code class="filename">functional</code></p></li><li class="listitem"><p><code class="filename">tr1/memory</code> no longer includes <code class="filename">algorithm</code></p></li><li class="listitem"><p><code class="filename">tr1/random</code> no longer includes <code class="filename">algorithm</code> or <code class="filename">fstream</code></p></li></ul></div><p>
Debug mode for <code class="filename">unordered_map</code> and <code class="filename">unordered_set</code>. Debug mode for <code class="filename">unordered_map</code> and <code class="filename">unordered_set</code>.
</p><p> </p><p>
Parallel mode first appears. Parallel mode first appears.
@ -151,4 +152,84 @@ Parallel mode first appears.
PCH binary files no longer installed. Instead, the source files are installed. PCH binary files no longer installed. Instead, the source files are installed.
</p><p> </p><p>
Namespace pb_ds moved to __gnu_pb_ds. Namespace pb_ds moved to __gnu_pb_ds.
</p></div><div class="sect2" title="4.4"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_440"></a><code class="constant">4.4</code></h3></div></div></div><p>
</p><p>
C++0X features.
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
Added.
</p><p>
<code class="filename">atomic</code>,
<code class="filename">chrono</code>,
<code class="filename">condition_variable</code>,
<code class="filename">forward_list</code>,
<code class="filename">initializer_list</code>,
<code class="filename">mutex</code>,
<code class="filename">ratio</code>,
<code class="filename">thread</code>
</p></li><li class="listitem"><p>
Updated and improved.
</p><p>
<code class="filename">algorithm</code>,
<code class="filename">system_error</code>,
<code class="filename">type_traits</code>
</p></li><li class="listitem"><p>
Use of the GNU extension namespace association converted to inline namespaces.
</p></li><li class="listitem"><p>
Preliminary support for <code class="classname">initializer_list</code>
and defaulted and deleted constructors in container classes.
</p></li><li class="listitem"><p>
<code class="classname">unique_ptr</code>.
</p></li><li class="listitem"><p>
Support for new character types <span class="type">char16_t</span>
and <span class="type">char32_t</span> added
to <code class="classname">char_traits</code>, <code class="classname">basic_string</code>, <code class="classname">numeric_limits</code>,
and assorted compile-time type traits.
</p></li><li class="listitem"><p>
Support for string conversions <code class="function">to_string</code>
and <code class="function">to_wstring</code>.
</p></li><li class="listitem"><p>
Member functions taking string arguments were added to iostreams
including <code class="classname">basic_filebuf</code>, <code class="classname">basic_ofstream</code>,
and <code class="classname">basic_ifstream</code>.
</p></li><li class="listitem"><p>
Exception propagation support,
including <code class="classname">exception_ptr</code>, <code class="function">current_exception</code>, <code class="function">copy_exception</code>,
and <code class="function">rethrow_exception</code>.
</p></li></ul></div><p>
Uglification of <code class="literal">try</code> to <code class="literal">__try</code>
and <code class="literal">catch</code> to <code class="literal">__catch</code>.
</p><p>
Audit of internal mutex usage, conversion to funtions returning static
local mutex.
</p><p> Extensions
added: <code class="filename">ext/pointer.h</code>
and <code class="filename">ext/extptr_allocator.h</code>. Support
for non-standard pointer types has been added
to <code class="classname">vector</code>
and <code class="classname">forward_list</code>.
</p></div><div class="sect2" title="4.5"><div class="titlepage"><div><div><h3 class="title"><a id="api.rel_450"></a><code class="constant">4.5</code></h3></div></div></div><p>
</p><p>
C++0X features.
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
Added.
</p><p>
<code class="filename">future</code>,
<code class="filename">random</code>
</p></li><li class="listitem"><p>
Updated and improved.
</p><p>
<code class="filename">atomic</code>,
<code class="filename">system_error</code>,
<code class="filename">type_traits</code>
</p></li><li class="listitem"><p>
Add support for explicit operators and standard layout types.
</p></li></ul></div><p>
Profile mode first appears.
</p><p>
Support for decimal floating-point arithmetic, including <code class="classname">decimal32</code>, <code class="classname">decimal64</code>, and <code class="classname">decimal128</code>.
</p><p>
Python pretty-printers are added for use with appropriately-advanced versions of <span class="command"><strong>gdb</strong></span>.
</p><p>
Audit for application of function attributes notrow, const, pure, and noreturn.
</p><p> Extensions modified: <code class="filename">ext/throw_allocator.h</code>. In addition, experimental support was added for <code class="filename">random</code> serialization operators.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="abi.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="backwards.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ABI Policy and Guidelines </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Backwards Compatibility</td></tr></table></div></body></html> </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="abi.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="appendix_porting.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="backwards.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ABI Policy and Guidelines </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Backwards Compatibility</td></tr></table></div></body></html>

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Appendix A.  Contributing</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="bk01pt12ch41s03.html" title="Use" /><link rel="next" href="source_organization.html" title="Directory Layout and Source Conventions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix A.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Appendix A.  Contributing</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="bk01pt12ch41s03.html" title="Use" /><link rel="next" href="source_organization.html" title="Directory Layout and Source Conventions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix A. 
Contributing Contributing
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch41s03.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="source_organization.html">Next</a></td></tr></table><hr /></div><div class="appendix" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.contrib"></a>Appendix A.  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch41s03.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="source_organization.html">Next</a></td></tr></table><hr /></div><div class="appendix" title="Appendix A.  Contributing"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.contrib"></a>Appendix A. 
Contributing Contributing
<a id="id622754" class="indexterm"></a> <a id="id451444" class="indexterm"></a>
</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="sect1"><a href="source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="sect1"><a href="source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="sect2"><a href="source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="documentation_style.html">Documentation Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="documentation_style.html#doc_style.doxygen">Doxygen</a></span></dt><dt><span class="sect2"><a href="documentation_style.html#doc_style.docbook">Docbook</a></span></dt></dl></dd><dt><span class="sect1"><a href="source_design_notes.html">Design Notes</a></span></dt></dl></div><p> </h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="sect1"><a href="source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="sect1"><a href="source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="sect2"><a href="source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="documentation_style.html">Documentation Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="documentation_style.html#doc_style.doxygen">Doxygen</a></span></dt><dt><span class="sect2"><a href="documentation_style.html#doc_style.docbook">Docbook</a></span></dt></dl></dd><dt><span class="sect1"><a href="source_design_notes.html">Design Notes</a></span></dt></dl></div><p>
The GNU C++ Library follows an open development model. Active The GNU C++ Library follows an open development model. Active
contributors are assigned maintainer-ship responsibility, and given contributors are assigned maintainer-ship responsibility, and given
write access to the source repository. First time contributors write access to the source repository. First time contributors
should follow this procedure: should follow this procedure:
</p><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="contrib.list"></a>Contributor Checklist</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="list.reading"></a>Reading</h3></div></div></div><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="sect1" title="Contributor Checklist"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="contrib.list"></a>Contributor Checklist</h2></div></div></div><div class="sect2" title="Reading"><div class="titlepage"><div><div><h3 class="title"><a id="list.reading"></a>Reading</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
Get and read the relevant sections of the C++ language Get and read the relevant sections of the C++ language
specification. Copies of the full ISO 14882 standard are specification. Copies of the full ISO 14882 standard are
available on line via the ISO mirror site for committee available on line via the ISO mirror site for committee
@ -24,30 +24,30 @@
<a class="ulink" href="http://www.ansi.org" target="_top">here.</a> <a class="ulink" href="http://www.ansi.org" target="_top">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 class="ulink" href="http://webstore.ansi.org/RecordDetail.aspx?sku=ISO/IEC%2014882:2003" target="_top">buy the standard on-line.)</a> <a class="ulink" href="http://webstore.ansi.org/RecordDetail.aspx?sku=ISO/IEC%2014882:2003" target="_top">buy the standard on-line.)</a>
</p></li><li><p> </p></li><li class="listitem"><p>
The library working group bugs, and known defects, can The library working group bugs, and known defects, can
be obtained here: be obtained here:
<a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/" target="_top">http://www.open-std.org/jtc1/sc22/wg21 </a> <a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/" target="_top">http://www.open-std.org/jtc1/sc22/wg21 </a>
</p></li><li><p> </p></li><li class="listitem"><p>
The newsgroup dedicated to standardization issues is The newsgroup dedicated to standardization issues is
comp.std.c++: this FAQ for this group is quite useful and comp.std.c++: this FAQ for this group is quite useful and
can be can be
found <a class="ulink" href="http://www.comeaucomputing.com/csc/faq.html" target="_top"> found <a class="ulink" href="http://www.comeaucomputing.com/csc/faq.html" target="_top">
here </a>. here </a>.
</p></li><li><p> </p></li><li class="listitem"><p>
Peruse Peruse
the <a class="ulink" href="http://www.gnu.org/prep/standards" target="_top">GNU the <a class="ulink" href="http://www.gnu.org/prep/standards" target="_top">GNU
Coding Standards</a>, and chuckle when you hit the part Coding Standards</a>, and chuckle when you hit the part
about “<span class="quote">Using Languages Other Than C</span>”. about <span class="quote"><span class="quote">Using Languages Other Than C</span></span>.
</p></li><li><p> </p></li><li class="listitem"><p>
Be familiar with the extensions that preceded these Be familiar with the extensions that preceded these
general GNU rules. These style issues for libstdc++ can be general GNU rules. These style issues for libstdc++ can be
found <a class="link" href="source_code_style.html" title="Coding Style">here</a>. found <a class="link" href="source_code_style.html" title="Coding Style">here</a>.
</p></li><li><p> </p></li><li class="listitem"><p>
And last but certainly not least, read the And last but certainly not least, read the
library-specific information library-specific information
found <a class="link" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"> here</a>. found <a class="link" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance"> here</a>.
</p></li></ul></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="list.copyright"></a>Assignment</h3></div></div></div><p> </p></li></ul></div></div><div class="sect2" title="Assignment"><div class="titlepage"><div><div><h3 class="title"><a id="list.copyright"></a>Assignment</h3></div></div></div><p>
Small changes can be accepted without a copyright assignment form on Small changes can be accepted without a copyright assignment form on
file. New code and additions to the library need completed copyright file. New code and additions to the library need completed copyright
assignment form on file at the FSF. Note: your employer may be required assignment form on file at the FSF. Note: your employer may be required
@ -56,10 +56,10 @@
Historically, the libstdc++ assignment form added the following Historically, the libstdc++ assignment form added the following
question: question:
</p><p> </p><p>
<span class="quote"> <span class="quote"><span class="quote">
Which Belgian comic book character is better, Tintin or Asterix, and Which Belgian comic book character is better, Tintin or Asterix, and
why? why?
</span> </span></span>
</p><p> </p><p>
While not strictly necessary, humoring the maintainers and answering While not strictly necessary, humoring the maintainers and answering
this question would be appreciated. this question would be appreciated.
@ -74,29 +74,29 @@
requesting an assignment form from requesting an assignment form from
<code class="email">&lt;<a class="email" href="mailto:mailto:assign@gnu.org">mailto:assign@gnu.org</a>&gt;</code>, please cc the libstdc++ <code class="email">&lt;<a class="email" href="mailto:mailto:assign@gnu.org">mailto:assign@gnu.org</a>&gt;</code>, please cc the libstdc++
maintainer above so that progress can be monitored. maintainer above so that progress can be monitored.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="list.getting"></a>Getting Sources</h3></div></div></div><p> </p></div><div class="sect2" title="Getting Sources"><div class="titlepage"><div><div><h3 class="title"><a id="list.getting"></a>Getting Sources</h3></div></div></div><p>
<a class="ulink" href="http://gcc.gnu.org/svnwrite.html" target="_top">Getting write access <a class="ulink" href="http://gcc.gnu.org/svnwrite.html" target="_top">Getting write access
(look for "Write after approval")</a> (look for "Write after approval")</a>
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="list.patches"></a>Submitting Patches</h3></div></div></div><p> </p></div><div class="sect2" title="Submitting Patches"><div class="titlepage"><div><div><h3 class="title"><a id="list.patches"></a>Submitting Patches</h3></div></div></div><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><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
A description of the bug and how your patch fixes this A description of the bug and how your patch fixes this
bug. For new features a description of the feature and your bug. For new features a description of the feature and your
implementation. implementation.
</p></li><li><p> </p></li><li class="listitem"><p>
A ChangeLog entry as plain text; see the various A ChangeLog entry as plain text; see the various
ChangeLog files for format and content. If using you are ChangeLog files for format and content. If using you are
using emacs as your editor, simply position the insertion using emacs as your editor, simply position the insertion
point at the beginning of your change and hit CX-4a to bring point at the beginning of your change and hit CX-4a to bring
up the appropriate ChangeLog entry. See--magic! Similar up the appropriate ChangeLog entry. See--magic! Similar
functionality also exists for vi. functionality also exists for vi.
</p></li><li><p> </p></li><li class="listitem"><p>
A testsuite submission or sample program that will A testsuite submission or sample program that will
easily and simply show the existing error or test new easily and simply show the existing error or test new
functionality. functionality.
</p></li><li><p> </p></li><li class="listitem"><p>
The patch itself. If you are accessing the SVN The patch itself. If you are accessing the SVN
repository use <span class="command"><strong>svn update; svn diff NEW</strong></span>; repository use <span class="command"><strong>svn update; svn diff NEW</strong></span>;
else, use <span class="command"><strong>diff -cp OLD NEW</strong></span> ... If your else, use <span class="command"><strong>diff -cp OLD NEW</strong></span> ... If your
@ -105,7 +105,7 @@
diff. The <a class="ulink" href="http://gcc.gnu.org/wiki/SvnTricks" target="_top">SVN diff. The <a class="ulink" href="http://gcc.gnu.org/wiki/SvnTricks" target="_top">SVN
Tricks</a> wiki page has information on customising the Tricks</a> wiki page has information on customising the
output of <code class="code">svn diff</code>. output of <code class="code">svn diff</code>.
</p></li><li><p> </p></li><li class="listitem"><p>
When you have all these pieces, bundle them up in a When you have all these pieces, bundle them up in a
mail message and send it to libstdc++@gcc.gnu.org. All mail message and send it to libstdc++@gcc.gnu.org. All
patches and related discussion should be sent to the patches and related discussion should be sent to the

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Appendix C.  Free Software Needs Free Documentation</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="backwards.html" title="Backwards Compatibility" /><link rel="next" href="appendix_gpl.html" title="Appendix D.  GNU General Public License version 3" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix C.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Appendix C.  Free Software Needs Free Documentation</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="backwards.html" title="Backwards Compatibility" /><link rel="next" href="appendix_gpl.html" title="Appendix D.  GNU General Public License version 3" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix C. 
Free Software Needs Free Documentation Free Software Needs Free Documentation
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="backwards.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="appendix_gpl.html">Next</a></td></tr></table><hr /></div><div class="appendix" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.free"></a>Appendix C.  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="backwards.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="appendix_gpl.html">Next</a></td></tr></table><hr /></div><div class="appendix" title="Appendix C.  Free Software Needs Free Documentation"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.free"></a>Appendix C. 
Free Software Needs Free Documentation Free Software Needs Free Documentation
<a id="id675332" class="indexterm"></a> <a id="id519719" class="indexterm"></a>
</h2></div></div></div><p> </h2></div></div></div><p>
The biggest deficiency in free operating systems is not in the The biggest deficiency in free operating systems is not in the
software--it is the lack of good free manuals that we can include in software--it is the lack of good free manuals that we can include in
@ -120,5 +120,5 @@ that lists free books available from other publishers</a>].
</p><p>Copyright © 2004, 2005, 2006, 2007 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA</p><p>Verbatim copying and distribution of this entire article are </p><p>Copyright © 2004, 2005, 2006, 2007 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA</p><p>Verbatim copying and distribution of this entire article are
permitted worldwide, without royalty, in any medium, provided this permitted worldwide, without royalty, in any medium, provided this
notice is preserved.</p><p>Report any problems or suggestions to <code class="email">&lt;<a class="email" href="mailto:webmaster@fsf.org">webmaster@fsf.org</a>&gt;</code>.</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="backwards.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="appendix_gpl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Backwards Compatibility </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix D.  notice is preserved.</p><p>Report any problems or suggestions to <code class="email">&lt;<a class="email" href="mailto:webmaster@fsf.org">webmaster@fsf.org</a>&gt;</code>.</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="backwards.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="appendix_gpl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Backwards Compatibility </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix D. 
GNU General Public License version 3 <acronym class="acronym">GNU</acronym> General Public License version 3
</td></tr></table></div></body></html> </td></tr></table></div></body></html>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Appendix E. GNU Free Documentation License</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="appendix_gpl.html" title="Appendix D.  GNU General Public License version 3" /><link rel="next" href="bk01ix01.html" title="Index" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix E. GNU Free Documentation License</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_gpl.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="bk01ix01.html">Next</a></td></tr></table><hr /></div><div class="appendix" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.gfdl-1.2"></a>Appendix E. GNU Free Documentation License</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Appendix E. GNU Free Documentation License</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="appendix_gpl.html" title="Appendix D.  GNU General Public License version 3" /><link rel="next" href="bk01ix01.html" title="Index" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix E. GNU Free Documentation License</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_gpl.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="bk01ix01.html">Next</a></td></tr></table><hr /></div><div class="appendix" title="Appendix E. GNU Free Documentation License"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.gfdl-1.2"></a>Appendix E. GNU Free Documentation License</h2></div></div></div><p>
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Copyright (C) 2000, 2001, 2002 Free Software Foundation,
<abbr class="abbrev">Inc.</abbr> 51 Franklin <abbr class="abbrev">St</abbr>, Fifth Floor, <abbr class="abbrev">Inc.</abbr> 51 Franklin <abbr class="abbrev">St</abbr>, Fifth Floor,
Boston, <abbr class="abbrev">MA</abbr> 02110-1301 <abbr class="abbrev">USA</abbr>. Everyone is permitted to copy and Boston, <abbr class="abbrev">MA</abbr> 02110-1301 <abbr class="abbrev">USA</abbr>. Everyone is permitted to copy and
@ -173,36 +173,36 @@
filling the role of the Document, thus licensing distribution and filling the role of the Document, thus licensing distribution and
modification of the Modified Version to whoever possesses a copy of it. modification of the Modified Version to whoever possesses a copy of it.
In addition, you must do these things in the Modified Version: In addition, you must do these things in the Modified Version:
</p><div class="orderedlist"><ol type="A"><li> </p><div class="orderedlist"><ol class="orderedlist" type="A"><li class="listitem">
Use in the Title Page (and on the covers, if any) a title distinct Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions (which from that of the Document, and from those of previous versions (which
should, if there were any, be listed in the History section of the should, if there were any, be listed in the History section of the
Document). You may use the same title as a previous version if the Document). You may use the same title as a previous version if the
original publisher of that version gives permission. original publisher of that version gives permission.
</li><li> </li><li class="listitem">
List on the Title Page, as authors, one or more persons or entities List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five), Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement. unless they release you from this requirement.
</li><li> </li><li class="listitem">
State on the Title page the name of the publisher of the Modified State on the Title page the name of the publisher of the Modified
Version, as the publisher. Version, as the publisher.
</li><li> </li><li class="listitem">
Preserve all the copyright notices of the Document. Preserve all the copyright notices of the Document.
</li><li> </li><li class="listitem">
Add an appropriate copyright notice for your modifications adjacent to Add an appropriate copyright notice for your modifications adjacent to
the other copyright notices. the other copyright notices.
</li><li> </li><li class="listitem">
Include, immediately after the copyright notices, a license notice Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below. terms of this License, in the form shown in the Addendum below.
</li><li> </li><li class="listitem">
Preserve in that license notice the full lists of Invariant Sections Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice. and required Cover Texts given in the Document's license notice.
</li><li> </li><li class="listitem">
Include an unaltered copy of this License. Include an unaltered copy of this License.
</li><li> </li><li class="listitem">
Preserve the section Entitled "History", Preserve its Title, and add Preserve the section Entitled "History", Preserve its Title, and add
to it an item stating at least the title, year, new authors, and to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If publisher of the Modified Version as given on the Title Page. If
@ -210,7 +210,7 @@
stating the title, year, authors, and publisher of the Document as stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence. Version as stated in the previous sentence.
</li><li> </li><li class="listitem">
Preserve the network location, if any, given in the Document for Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise the public access to a Transparent copy of the Document, and likewise the
network locations given in the Document for previous versions it was network locations given in the Document for previous versions it was
@ -218,22 +218,22 @@
a network location for a work that was published at least four years a network location for a work that was published at least four years
before the Document itself, or if the original publisher of the before the Document itself, or if the original publisher of the
version it refers to gives permission. version it refers to gives permission.
</li><li> </li><li class="listitem">
For any section Entitled "Acknowledgements" or "Dedications", Preserve For any section Entitled "Acknowledgements" or "Dedications", Preserve
the Title of the section, and preserve in the section all the the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or substance and tone of each of the contributor acknowledgements and/or
dedications given therein. dedications given therein.
</li><li> </li><li class="listitem">
Preserve all the Invariant Sections of the Document, unaltered in Preserve all the Invariant Sections of the Document, unaltered in
their text and in their titles. Section numbers or the equivalent are their text and in their titles. Section numbers or the equivalent are
not considered part of the section titles. not considered part of the section titles.
</li><li> </li><li class="listitem">
Delete any section Entitled "Endorsements". Such a section may not be Delete any section Entitled "Endorsements". Such a section may not be
included in the Modified Version. included in the Modified Version.
</li><li> </li><li class="listitem">
Do not retitle any existing section to be Entitled "Endorsements" or Do not retitle any existing section to be Entitled "Endorsements" or
to conflict in title with any Invariant Section. to conflict in title with any Invariant Section.
</li><li> </li><li class="listitem">
Preserve any Warranty Disclaimers. Preserve any Warranty Disclaimers.
</li></ol></div><p> </li></ol></div><p>
If the Modified Version includes new front-matter sections or appendices If the Modified Version includes new front-matter sections or appendices
@ -391,5 +391,5 @@
software license, such as the GNU General Public License, to permit their software license, such as the GNU General Public License, to permit their
use in free software. use in free software.
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="appendix_gpl.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01ix01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix D.  </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="appendix_gpl.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01ix01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix D. 
GNU General Public License version 3 <acronym class="acronym">GNU</acronym> General Public License version 3
 </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Index</td></tr></table></div></body></html>  </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Index</td></tr></table></div></body></html>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Appendix D.  GNU General Public License version 3</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="appendix_free.html" title="Appendix C.  Free Software Needs Free Documentation" /><link rel="next" href="appendix_gfdl.html" title="Appendix E. GNU Free Documentation License" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix D.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Appendix D.  GNU General Public License version 3</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="appendix_free.html" title="Appendix C.  Free Software Needs Free Documentation" /><link rel="next" href="appendix_gfdl.html" title="Appendix E. GNU Free Documentation License" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix D. 
GNU General Public License version 3 <acronym class="acronym">GNU</acronym> General Public License version 3
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_free.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="appendix_gfdl.html">Next</a></td></tr></table><hr /></div><div class="appendix" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.gpl-3.0"></a>Appendix D.  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_free.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="appendix_gfdl.html">Next</a></td></tr></table><hr /></div><div class="appendix" title="Appendix D.  GNU General Public License version 3"><div class="titlepage"><div><div><h2 class="title"><a id="appendix.gpl-3.0"></a>Appendix D. 
<acronym class="acronym">GNU</acronym> General Public License version 3 <acronym class="acronym">GNU</acronym> General Public License version 3
</h2></div></div></div><p> </h2></div></div></div><p>
Version 3, 29 June 2007 Version 3, 29 June 2007
@ -76,7 +76,7 @@
</p><p> </p><p>
The precise terms and conditions for copying, distribution and modification The precise terms and conditions for copying, distribution and modification
follow. follow.
</p><h2><a id="id746936"></a> </p><h2><a id="id521172"></a>
TERMS AND CONDITIONS TERMS AND CONDITIONS
</h2><h2><a id="gpl-3-definitions"></a> </h2><h2><a id="gpl-3-definitions"></a>
0. Definitions. 0. Definitions.
@ -219,15 +219,15 @@
You may convey a work based on the Program, or the modifications to produce You may convey a work based on the Program, or the modifications to produce
it from the Program, in the form of source code under the terms of section it from the Program, in the form of source code under the terms of section
4, provided that you also meet all of these conditions: 4, provided that you also meet all of these conditions:
</p><div class="orderedlist"><ol type="a"><li><p> </p><div class="orderedlist"><ol class="orderedlist" type="a"><li class="listitem"><p>
The work must carry prominent notices stating that you modified it, and The work must carry prominent notices stating that you modified it, and
giving a relevant date. giving a relevant date.
</p></li><li><p> </p></li><li class="listitem"><p>
The work must carry prominent notices stating that it is released under The work must carry prominent notices stating that it is released under
this License and any conditions added under section 7. This requirement this License and any conditions added under section 7. This requirement
modifies the requirement in section 4 to “keep intact all modifies the requirement in section 4 to “keep intact all
notices”. notices”.
</p></li><li><p> </p></li><li class="listitem"><p>
You must license the entire work, as a whole, under this License to You must license the entire work, as a whole, under this License to
anyone who comes into possession of a copy. This License will therefore anyone who comes into possession of a copy. This License will therefore
apply, along with any applicable section 7 additional terms, to the apply, along with any applicable section 7 additional terms, to the
@ -235,7 +235,7 @@
packaged. This License gives no permission to license the work in any packaged. This License gives no permission to license the work in any
other way, but it does not invalidate such permission if you have other way, but it does not invalidate such permission if you have
separately received it. separately received it.
</p></li><li><p> </p></li><li class="listitem"><p>
If the work has interactive user interfaces, each must display If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your work need interfaces that do not display Appropriate Legal Notices, your work need
@ -255,12 +255,12 @@
You may convey a covered work in object code form under the terms of You may convey a covered work in object code form under the terms of
sections 4 and 5, provided that you also convey the machine-readable sections 4 and 5, provided that you also convey the machine-readable
Corresponding Source under the terms of this License, in one of these ways: Corresponding Source under the terms of this License, in one of these ways:
</p><div class="orderedlist"><ol type="a"><li><p> </p><div class="orderedlist"><ol class="orderedlist" type="a"><li class="listitem"><p>
Convey the object code in, or embodied in, a physical product (including Convey the object code in, or embodied in, a physical product (including
a physical distribution medium), accompanied by the Corresponding Source a physical distribution medium), accompanied by the Corresponding Source
fixed on a durable physical medium customarily used for software fixed on a durable physical medium customarily used for software
interchange. interchange.
</p></li><li><p> </p></li><li class="listitem"><p>
Convey the object code in, or embodied in, a physical product (including Convey the object code in, or embodied in, a physical product (including
a physical distribution medium), accompanied by a written offer, valid a physical distribution medium), accompanied by a written offer, valid
for at least three years and valid for as long as you offer spare parts for at least three years and valid for as long as you offer spare parts
@ -271,12 +271,12 @@
price no more than your reasonable cost of physically performing this price no more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the Corresponding Source from conveying of source, or (2) access to copy the Corresponding Source from
a network server at no charge. a network server at no charge.
</p></li><li><p> </p></li><li class="listitem"><p>
Convey individual copies of the object code with a copy of the written Convey individual copies of the object code with a copy of the written
offer to provide the Corresponding Source. This alternative is allowed offer to provide the Corresponding Source. This alternative is allowed
only occasionally and noncommercially, and only if you received the only occasionally and noncommercially, and only if you received the
object code with such an offer, in accord with subsection 6b. object code with such an offer, in accord with subsection 6b.
</p></li><li><p> </p></li><li class="listitem"><p>
Convey the object code by offering access from a designated place Convey the object code by offering access from a designated place
(gratis or for a charge), and offer equivalent access to the (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no Corresponding Source in the same way through the same place at no
@ -289,7 +289,7 @@
Regardless of what server hosts the Corresponding Source, you remain Regardless of what server hosts the Corresponding Source, you remain
obligated to ensure that it is available for as long as needed to obligated to ensure that it is available for as long as needed to
satisfy these requirements. satisfy these requirements.
</p></li><li><p> </p></li><li class="listitem"><p>
Convey the object code using peer-to-peer transmission, provided you Convey the object code using peer-to-peer transmission, provided you
inform other peers where the object code and Corresponding Source of the inform other peers where the object code and Corresponding Source of the
work are being offered to the general public at no charge under work are being offered to the general public at no charge under
@ -366,24 +366,24 @@
Notwithstanding any other provision of this License, for material you add Notwithstanding any other provision of this License, for material you add
to a covered work, you may (if authorized by the copyright holders of that to a covered work, you may (if authorized by the copyright holders of that
material) supplement the terms of this License with terms: material) supplement the terms of this License with terms:
</p><div class="orderedlist"><ol type="a"><li><p> </p><div class="orderedlist"><ol class="orderedlist" type="a"><li class="listitem"><p>
Disclaiming warranty or limiting liability differently from the terms Disclaiming warranty or limiting liability differently from the terms
of sections 15 and 16 of this License; or of sections 15 and 16 of this License; or
</p></li><li><p> </p></li><li class="listitem"><p>
Requiring preservation of specified reasonable legal notices or author Requiring preservation of specified reasonable legal notices or author
attributions in that material or in the Appropriate Legal Notices attributions in that material or in the Appropriate Legal Notices
displayed by works containing it; or displayed by works containing it; or
</p></li><li><p> </p></li><li class="listitem"><p>
Prohibiting misrepresentation of the origin of that material, or Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or reasonable ways as different from the original version; or
</p></li><li><p> </p></li><li class="listitem"><p>
Limiting the use for publicity purposes of names of licensors or Limiting the use for publicity purposes of names of licensors or
authors of the material; or authors of the material; or
</p></li><li><p> </p></li><li class="listitem"><p>
Declining to grant rights under trademark law for use of some trade Declining to grant rights under trademark law for use of some trade
names, trademarks, or service marks; or names, trademarks, or service marks; or
</p></li><li><p> </p></li><li class="listitem"><p>
Requiring indemnification of licensors and authors of that material by Requiring indemnification of licensors and authors of that material by
anyone who conveys the material (or modified versions of it) with anyone who conveys the material (or modified versions of it) with
contractual assumptions of liability to the recipient, for any contractual assumptions of liability to the recipient, for any
@ -617,7 +617,7 @@
waiver of all civil liability in connection with the Program, unless a waiver of all civil liability in connection with the Program, unless a
warranty or assumption of liability accompanies a copy of the Program in warranty or assumption of liability accompanies a copy of the Program in
return for a fee. return for a fee.
</p><h2><a id="id654357"></a> </p><h2><a id="id519116"></a>
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
</h2><h2><a id="HowToApply"></a> </h2><h2><a id="HowToApply"></a>
How to Apply These Terms to Your New Programs How to Apply These Terms to Your New Programs

File diff suppressed because one or more lines are too long

View File

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 17. Associative</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="containers.html" title="Part VII.  Containers" /><link rel="prev" href="vector.html" title="vector" /><link rel="next" href="bitset.html" title="bitset" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 17. Associative</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="vector.html">Prev</a> </td><th width="60%" align="center">Part VII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 17. Associative</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="containers.html" title="Part VII.  Containers" /><link rel="prev" href="vector.html" title="vector" /><link rel="next" href="bitset.html" title="bitset" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 17. Associative</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="vector.html">Prev</a> </td><th width="60%" align="center">Part VII. 
Containers Containers
</th><td width="20%" align="right"> <a accesskey="n" href="bitset.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.containers.associative"></a>Chapter 17. Associative</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="sect1"><a href="bitset.html">bitset</a></span></dt><dd><dl><dt><span class="sect2"><a href="bitset.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="sect2"><a href="bitset.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="containers.associative.insert_hints"></a>Insertion Hints</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="bitset.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 17. Associative"><div class="titlepage"><div><div><h2 class="title"><a id="manual.containers.associative"></a>Chapter 17. Associative</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="sect1"><a href="bitset.html">bitset</a></span></dt><dd><dl><dt><span class="sect2"><a href="bitset.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="sect2"><a href="bitset.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></div><div class="sect1" title="Insertion Hints"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="containers.associative.insert_hints"></a>Insertion Hints</h2></div></div></div><p>
Section [23.1.2], Table 69, of the C++ standard lists this Section [23.1.2], Table 69, of the C++ standard lists this
function for all of the associative containers (map, set, etc): function for all of the associative containers (map, set, etc):
</p><pre class="programlisting"> </p><pre class="programlisting">
a.insert(p,t); a.insert(p,t);
</pre><p> </pre><p>
where 'p' is an iterator into the container 'a', and 't' is the where 'p' is an iterator into the container 'a', and 't' is the
item to insert. The standard says that “<span class="quote"><code class="code">t</code> is item to insert. The standard says that <span class="quote"><span class="quote"><code class="code">t</code> is
inserted as close as possible to the position just prior to inserted as close as possible to the position just prior to
<code class="code">p</code>.</span>” (Library DR #233 addresses this topic, <code class="code">p</code>.</span></span> (Library DR #233 addresses this topic,
referring to <a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1780.html" target="_top">N1780</a>. referring to <a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1780.html" target="_top">N1780</a>.
Since version 4.2 GCC implements the resolution to DR 233, so Since version 4.2 GCC implements the resolution to DR 233, so
that insertions happen as close as possible to the hint. For that insertions happen as close as possible to the hint. For
@ -31,25 +31,25 @@
than</em></span> and <span class="emphasis"><em>less than</em></span> refer to the than</em></span> and <span class="emphasis"><em>less than</em></span> refer to the
results of the strict weak ordering imposed on the container by results of the strict weak ordering imposed on the container by
its comparison object, which defaults to (basically) its comparison object, which defaults to (basically)
<span class="quote">&lt;</span>”. Using those phrases is semantically sloppy, <span class="quote"><span class="quote">&lt;</span></span>. Using those phrases is semantically sloppy,
but I didn't want to get bogged down in syntax. I assume that if but I didn't want to get bogged down in syntax. I assume that if
you are intelligent enough to use your own comparison objects, you are intelligent enough to use your own comparison objects,
you are also intelligent enough to assign “<span class="quote">greater</span> you are also intelligent enough to assign <span class="quote"><span class="quote">greater</span></span>
and “<span class="quote">lesser</span>” their new meanings in the next and <span class="quote"><span class="quote">lesser</span></span> their new meanings in the next
paragraph. *grin* paragraph. *grin*
</p><p> </p><p>
If the <code class="code">hint</code> parameter ('p' above) is equivalent to: If the <code class="code">hint</code> parameter ('p' above) is equivalent to:
</p><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
<code class="code">begin()</code>, then the item being inserted should <code class="code">begin()</code>, then the item being inserted should
have a key less than all the other keys in the container. have a key less than all the other keys in the container.
The item will be inserted at the beginning of the container, The item will be inserted at the beginning of the container,
becoming the new entry at <code class="code">begin()</code>. becoming the new entry at <code class="code">begin()</code>.
</p></li><li><p> </p></li><li class="listitem"><p>
<code class="code">end()</code>, then the item being inserted should have <code class="code">end()</code>, then the item being inserted should have
a key greater than all the other keys in the container. The a key greater than all the other keys in the container. The
item will be inserted at the end of the container, becoming item will be inserted at the end of the container, becoming
the new entry at <code class="code">end()</code>. the new entry at <code class="code">end()</code>.
</p></li><li><p> </p></li><li class="listitem"><p>
neither <code class="code">begin()</code> nor <code class="code">end()</code>, then: neither <code class="code">begin()</code> nor <code class="code">end()</code>, then:
Let <code class="code">h</code> be the entry in the container pointed to Let <code class="code">h</code> be the entry in the container pointed to
by <code class="code">hint</code>, that is, <code class="code">h = *hint</code>. Then by <code class="code">hint</code>, that is, <code class="code">h = *hint</code>. Then
@ -59,10 +59,10 @@
<code class="code">h</code> and <code class="code">h</code>'s predecessor. <code class="code">h</code> and <code class="code">h</code>'s predecessor.
</p></li></ul></div><p> </p></li></ul></div><p>
For <code class="code">multimap</code> and <code class="code">multiset</code>, the For <code class="code">multimap</code> and <code class="code">multiset</code>, the
restrictions are slightly looser: “<span class="quote">greater than</span> restrictions are slightly looser: <span class="quote"><span class="quote">greater than</span></span>
should be replaced by “<span class="quote">not less than</span>”and “<span class="quote">less should be replaced by <span class="quote"><span class="quote">not less than</span></span>and <span class="quote"><span class="quote">less
than</span>” should be replaced by “<span class="quote">not greater than</span></span> should be replaced by <span class="quote"><span class="quote">not greater
than.</span>” (Why not replace greater with than.</span></span> (Why not replace greater with
greater-than-or-equal-to? You probably could in your head, but greater-than-or-equal-to? You probably could in your head, but
the mathematicians will tell you that it isn't the same thing.) the mathematicians will tell you that it isn't the same thing.)
</p><p> </p><p>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>auto_ptr</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; auto_ptr&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="memory.html" title="Chapter 11. Memory" /><link rel="prev" href="memory.html" title="Chapter 11. Memory" /><link rel="next" href="shared_ptr.html" title="shared_ptr" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">auto_ptr</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="memory.html">Prev</a> </td><th width="60%" align="center">Chapter 11. Memory</th><td width="20%" align="right"> <a accesskey="n" href="shared_ptr.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.util.memory.auto_ptr"></a>auto_ptr</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="auto_ptr.limitations"></a>Limitations</h3></div></div></div><p>Explaining all of the fun and delicious things that can <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>auto_ptr</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; auto_ptr&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="memory.html" title="Chapter 11. Memory" /><link rel="prev" href="memory.html" title="Chapter 11. Memory" /><link rel="next" href="shared_ptr.html" title="shared_ptr" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">auto_ptr</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="memory.html">Prev</a> </td><th width="60%" align="center">Chapter 11. Memory</th><td width="20%" align="right"> <a accesskey="n" href="shared_ptr.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="auto_ptr"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.util.memory.auto_ptr"></a>auto_ptr</h2></div></div></div><div class="sect2" title="Limitations"><div class="titlepage"><div><div><h3 class="title"><a id="auto_ptr.limitations"></a>Limitations</h3></div></div></div><p>Explaining all of the fun and delicious things that can
happen with misuse of the <code class="classname">auto_ptr</code> class happen with misuse of the <code class="classname">auto_ptr</code> class
template (called <acronym class="acronym">AP</acronym> here) would take some template (called <acronym class="acronym">AP</acronym> here) would take some
time. Suffice it to say that the use of <acronym class="acronym">AP</acronym> time. Suffice it to say that the use of <acronym class="acronym">AP</acronym>
@ -51,7 +51,7 @@
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
own <code class="code">auto_array_ptr</code> for that situation (in fact, this has own <code class="code">auto_array_ptr</code> for that situation (in fact, this has
been done many times; check the mailing lists, Usenet, Boost, etc). been done many times; check the mailing lists, Usenet, Boost, etc).
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="auto_ptr.using"></a>Use in Containers</h3></div></div></div><p> </p></div><div class="sect2" title="Use in Containers"><div class="titlepage"><div><div><h3 class="title"><a id="auto_ptr.using"></a>Use in Containers</h3></div></div></div><p>
</p><p>All of the <a class="link" href="containers.html" title="Part VII.  Containers">containers</a> </p><p>All of the <a class="link" href="containers.html" title="Part VII.  Containers">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:
@ -70,7 +70,7 @@
</p><p> </p><p>
The resulting rule is simple: <span class="emphasis"><em>Never ever use a The resulting rule is simple: <span class="emphasis"><em>Never ever use a
container of auto_ptr objects</em></span>. The standard says that container of auto_ptr objects</em></span>. The standard says that
<span class="quote">undefined</span>” behavior is the result, but it is <span class="quote"><span class="quote">undefined</span></span> behavior is the result, but it is
guaranteed to be messy. guaranteed to be messy.
</p><p> </p><p>
To prevent you from doing this to yourself, the To prevent you from doing this to yourself, the

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Backwards Compatibility</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; backwards&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="api.html" title="API Evolution and Deprecation History" /><link rel="next" href="appendix_free.html" title="Appendix C.  Free Software Needs Free Documentation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Backwards Compatibility</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="api.html">Prev</a> </td><th width="60%" align="center">Appendix B.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Backwards Compatibility</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; backwards&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="api.html" title="API Evolution and Deprecation History" /><link rel="next" href="appendix_free.html" title="Appendix C.  Free Software Needs Free Documentation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Backwards Compatibility</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="api.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance Porting and Maintenance
</th><td width="20%" align="right"> <a accesskey="n" href="appendix_free.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.appendix.porting.backwards"></a>Backwards Compatibility</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.first"></a>First</h3></div></div></div><p>The first generation GNU C++ library was called libg++. It was a </th><td width="20%" align="right"> <a accesskey="n" href="appendix_free.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Backwards Compatibility"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.appendix.porting.backwards"></a>Backwards Compatibility</h2></div></div></div><div class="sect2" title="First"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.first"></a>First</h3></div></div></div><p>The first generation GNU C++ library was called libg++. It was a
separate GNU project, although reliably paired with GCC. Rumors imply separate GNU project, although reliably paired with GCC. Rumors imply
that it had a working relationship with at least two kinds of that it had a working relationship with at least two kinds of
dinosaur. dinosaur.
@ -16,9 +16,9 @@ now and are well-supported, whereas genclass (mostly) predates them.)
ISO Standard (e.g., statistical analysis). While there are a lot of ISO Standard (e.g., statistical analysis). While there are a lot of
really useful things that are used by a lot of people, the Standards really useful things that are used by a lot of people, the Standards
Committee couldn't include everything, and so a lot of those Committee couldn't include everything, and so a lot of those
<span class="quote">obvious</span>” classes didn't get included. <span class="quote"><span class="quote">obvious</span></span> classes didn't get included.
</p><p>Known Issues include many of the limitations of its immediate ancestor.</p><p>Portability notes and known implementation limitations are as follows.</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id744149"></a>No <code class="code">ios_base</code></h4></div></div></div><p> At least some older implementations don't have <code class="code">std::ios_base</code>, so you should use <code class="code">std::ios::badbit</code>, <code class="code">std::ios::failbit</code> and <code class="code">std::ios::eofbit</code> and <code class="code">std::ios::goodbit</code>. </p><p>Known Issues include many of the limitations of its immediate ancestor.</p><p>Portability notes and known implementation limitations are as follows.</p><div class="sect3" title="No ios_base"><div class="titlepage"><div><div><h4 class="title"><a id="id381437"></a>No <code class="code">ios_base</code></h4></div></div></div><p> At least some older implementations don't have <code class="code">std::ios_base</code>, so you should use <code class="code">std::ios::badbit</code>, <code class="code">std::ios::failbit</code> and <code class="code">std::ios::eofbit</code> and <code class="code">std::ios::goodbit</code>.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id744181"></a>No <code class="code">cout</code> in <code class="code">ostream.h</code>, no <code class="code">cin</code> in <code class="code">istream.h</code></h4></div></div></div><p> </p></div><div class="sect3" title="No cout in ostream.h, no cin in istream.h"><div class="titlepage"><div><div><h4 class="title"><a id="id381469"></a>No <code class="code">cout</code> in <code class="code">ostream.h</code>, no <code class="code">cin</code> in <code class="code">istream.h</code></h4></div></div></div><p>
In earlier versions of the standard, In earlier versions of the standard,
<code class="filename">fstream.h</code>, <code class="filename">fstream.h</code>,
<code class="filename">ostream.h</code> <code class="filename">ostream.h</code>
@ -32,7 +32,7 @@ archived. For the desperate,
the <a class="ulink" href="http://gcc.gnu.org/extensions.html" target="_top">GCC extensions the <a class="ulink" href="http://gcc.gnu.org/extensions.html" target="_top">GCC extensions
page</a> describes where to find the last libg++ source. The code is page</a> describes where to find the last libg++ source. The code is
considered replaced and rewritten. considered replaced and rewritten.
</p></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.second"></a>Second</h3></div></div></div><p> </p></div></div><div class="sect2" title="Second"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.second"></a>Second</h3></div></div></div><p>
The second generation GNU C++ library was called libstdc++, or The second generation GNU C++ library was called libstdc++, or
libstdc++-v2. It spans the time between libg++ and pre-ISO C++ libstdc++-v2. It spans the time between libg++ and pre-ISO C++
standardization and is usually associated with the following GCC standardization and is usually associated with the following GCC
@ -44,7 +44,7 @@ considered replaced and rewritten.
archived. The code is considered replaced and rewritten. archived. The code is considered replaced and rewritten.
</p><p> </p><p>
Portability notes and known implementation limitations are as follows. Portability notes and known implementation limitations are as follows.
</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id744279"></a>Namespace <code class="code">std::</code> not supported</h4></div></div></div><p> </p><div class="sect3" title="Namespace std:: not supported"><div class="titlepage"><div><div><h4 class="title"><a id="id381567"></a>Namespace <code class="code">std::</code> not supported</h4></div></div></div><p>
Some care is required to support C++ compiler and or library Some care is required to support C++ compiler and or library
implementation that do not have the standard library in implementation that do not have the standard library in
<code class="code">namespace std</code>. <code class="code">namespace std</code>.
@ -74,7 +74,7 @@ considered replaced and rewritten.
</p><p> </p><p>
Another pre-processor based approach is to define a macro Another pre-processor based approach is to define a macro
<code class="code">NAMESPACE_STD</code>, which is defined to either <code class="code">NAMESPACE_STD</code>, which is defined to either
<span class="quote"> </span>” or “<span class="quote">std</span>” based on a compile-type <span class="quote"><span class="quote"> </span></span> or <span class="quote"><span class="quote">std</span></span> based on a compile-type
test. On GNU systems, this can be done with autotools by means of test. On GNU systems, this can be done with autotools by means of
an autoconf test (see below) for <code class="code">HAVE_NAMESPACE_STD</code>, an autoconf test (see below) for <code class="code">HAVE_NAMESPACE_STD</code>,
then using that to set a value for the <code class="code">NAMESPACE_STD</code> then using that to set a value for the <code class="code">NAMESPACE_STD</code>
@ -108,20 +108,20 @@ AC_DEFUN([AC_CXX_NAMESPACE_STD], [
AC_DEFINE(HAVE_NAMESPACE_STD,,[Define if g++ supports namespace std. ]) AC_DEFINE(HAVE_NAMESPACE_STD,,[Define if g++ supports namespace std. ])
fi fi
]) ])
</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id673182"></a>Illegal iterator usage</h4></div></div></div><p> </pre></div><div class="sect3" title="Illegal iterator usage"><div class="titlepage"><div><div><h4 class="title"><a id="id414145"></a>Illegal iterator usage</h4></div></div></div><p>
The following illustrate implementation-allowed illegal iterator The following illustrate implementation-allowed illegal iterator
use, and then correct use. use, and then correct use.
</p><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
you cannot do <code class="code">ostream::operator&lt;&lt;(iterator)</code> you cannot do <code class="code">ostream::operator&lt;&lt;(iterator)</code>
to print the address of the iterator =&gt; use to print the address of the iterator =&gt; use
<code class="code">operator&lt;&lt; &amp;*iterator</code> instead <code class="code">operator&lt;&lt; &amp;*iterator</code> instead
</p></li><li><p> </p></li><li class="listitem"><p>
you cannot clear an iterator's reference (<code class="code">iterator = you cannot clear an iterator's reference (<code class="code">iterator =
0</code>) =&gt; use <code class="code">iterator = iterator_type();</code> 0</code>) =&gt; use <code class="code">iterator = iterator_type();</code>
</p></li><li><p> </p></li><li class="listitem"><p>
<code class="code">if (iterator)</code> won't work any more =&gt; use <code class="code">if (iterator)</code> won't work any more =&gt; use
<code class="code">if (iterator != iterator_type())</code> <code class="code">if (iterator != iterator_type())</code>
</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id673243"></a><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro </p></li></ul></div></div><div class="sect3" title="isspace from cctype is a macro"><div class="titlepage"><div><div><h4 class="title"><a id="id414206"></a><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
</h4></div></div></div><p> </h4></div></div></div><p>
Glibc 2.0.x and 2.1.x define <code class="filename">ctype.h</code> functionality as macros Glibc 2.0.x and 2.1.x define <code class="filename">ctype.h</code> functionality as macros
(isspace, isalpha etc.). (isspace, isalpha etc.).
@ -154,7 +154,7 @@ std:: (__ctype_b[(int) ( ( 'X' ) )] &amp; (unsigned short int) _ISspace ) ;
(<code class="filename">ctype.h</code>) and the (<code class="filename">ctype.h</code>) and the
definitions in namespace <code class="code">std::</code> definitions in namespace <code class="code">std::</code>
(<code class="code">&lt;cctype&gt;</code>). (<code class="code">&lt;cctype&gt;</code>).
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id586519"></a>No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></h4></div></div></div><p> </p></div><div class="sect3" title="No vector::at, deque::at, string::at"><div class="titlepage"><div><div><h4 class="title"><a id="id414300"></a>No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></h4></div></div></div><p>
One solution is to add an autoconf-test for this: One solution is to add an autoconf-test for this:
</p><pre class="programlisting"> </p><pre class="programlisting">
AC_MSG_CHECKING(for container::at) AC_MSG_CHECKING(for container::at)
@ -171,7 +171,7 @@ deque&lt;int&gt; test_deque(3);
test_deque.at(2); test_deque.at(2);
vector&lt;int&gt; test_vector(2); vector&lt;int&gt; test_vector(2);
test_vector.at(1); test_vector.at(1);
string test_string(“<span class="quote">test_string</span>”); string test_string(<span class="quote"><span class="quote">test_string</span></span>);
test_string.at(3); test_string.at(3);
], ],
[AC_MSG_RESULT(yes) [AC_MSG_RESULT(yes)
@ -180,7 +180,7 @@ AC_DEFINE(HAVE_CONTAINER_AT)],
</pre><p> </pre><p>
If you are using other (non-GNU) compilers it might be a good idea If you are using other (non-GNU) compilers it might be a good idea
to check for <code class="code">string::at</code> separately. to check for <code class="code">string::at</code> separately.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id586557"></a>No <code class="code">std::char_traits&lt;char&gt;::eof</code></h4></div></div></div><p> </p></div><div class="sect3" title="No std::char_traits&lt;char&gt;::eof"><div class="titlepage"><div><div><h4 class="title"><a id="id414338"></a>No <code class="code">std::char_traits&lt;char&gt;::eof</code></h4></div></div></div><p>
Use some kind of autoconf test, plus this: Use some kind of autoconf test, plus this:
</p><pre class="programlisting"> </p><pre class="programlisting">
#ifdef HAVE_CHAR_TRAITS #ifdef HAVE_CHAR_TRAITS
@ -188,7 +188,7 @@ AC_DEFINE(HAVE_CONTAINER_AT)],
#else #else
#define CPP_EOF EOF #define CPP_EOF EOF
#endif #endif
</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id586575"></a>No <code class="code">string::clear</code></h4></div></div></div><p> </pre></div><div class="sect3" title="No string::clear"><div class="titlepage"><div><div><h4 class="title"><a id="id414356"></a>No <code class="code">string::clear</code></h4></div></div></div><p>
There are two functions for deleting the contents of a string: There are two functions for deleting the contents of a string:
<code class="code">clear</code> and <code class="code">erase</code> (the latter returns the <code class="code">clear</code> and <code class="code">erase</code> (the latter returns the
string). string).
@ -206,25 +206,25 @@ erase(size_type __pos = 0, size_type __n = npos)
Unfortunately, <code class="code">clear</code> is not implemented in this Unfortunately, <code class="code">clear</code> is not implemented in this
version, so you should use <code class="code">erase</code> (which is probably version, so you should use <code class="code">erase</code> (which is probably
faster than <code class="code">operator=(charT*)</code>). faster than <code class="code">operator=(charT*)</code>).
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id586620"></a> </p></div><div class="sect3" title="Removal of ostream::form and istream::scan extensions"><div class="titlepage"><div><div><h4 class="title"><a id="id442672"></a>
Removal of <code class="code">ostream::form</code> and <code class="code">istream::scan</code> Removal of <code class="code">ostream::form</code> and <code class="code">istream::scan</code>
extensions extensions
</h4></div></div></div><p> </h4></div></div></div><p>
These are no longer supported. Please use stringstreams instead. These are no longer supported. Please use stringstreams instead.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id586640"></a>No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></h4></div></div></div><p> </p></div><div class="sect3" title="No basic_stringbuf, basic_stringstream"><div class="titlepage"><div><div><h4 class="title"><a id="id442691"></a>No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></h4></div></div></div><p>
Although the ISO standard <code class="code">i/ostringstream</code>-classes are Although the ISO standard <code class="code">i/ostringstream</code>-classes are
provided, (<code class="filename">sstream</code>), for provided, (<code class="filename">sstream</code>), for
compatibility with older implementations the pre-ISO compatibility with older implementations the pre-ISO
<code class="code">i/ostrstream</code> (<code class="filename">strstream</code>) interface is also provided, <code class="code">i/ostrstream</code> (<code class="filename">strstream</code>) interface is also provided,
with these caveats: with these caveats:
</p><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
<code class="code">strstream</code> is considered to be deprecated <code class="code">strstream</code> is considered to be deprecated
</p></li><li><p> </p></li><li class="listitem"><p>
<code class="code">strstream</code> is limited to <code class="code">char</code> <code class="code">strstream</code> is limited to <code class="code">char</code>
</p></li><li><p> </p></li><li class="listitem"><p>
with <code class="code">ostringstream</code> you don't have to take care of with <code class="code">ostringstream</code> you don't have to take care of
terminating the string or freeing its memory terminating the string or freeing its memory
</p></li><li><p> </p></li><li class="listitem"><p>
<code class="code">istringstream</code> can be re-filled (clear(); <code class="code">istringstream</code> can be re-filled (clear();
str(input);) str(input);)
</p></li></ul></div><p> </p></li></ul></div><p>
@ -242,7 +242,7 @@ erase(size_type __pos = 0, size_type __n = npos)
std::ostrstream oss; std::ostrstream oss;
#endif #endif
oss &lt;&lt;<span class="quote">Name=</span>&lt;&lt; m_name &lt;&lt;<span class="quote">, number=</span>&lt;&lt; m_number &lt;&lt; std::endl; oss &lt;&lt; <span class="quote"><span class="quote">Name=</span></span> &lt;&lt; m_name &lt;&lt; <span class="quote"><span class="quote">, number=</span></span> &lt;&lt; m_number &lt;&lt; std::endl;
... ...
#ifndef HAVE_SSTREAM #ifndef HAVE_SSTREAM
oss &lt;&lt; std::ends; // terminate the char*-string oss &lt;&lt; std::ends; // terminate the char*-string
@ -298,15 +298,15 @@ any = temp;
</pre><p> </pre><p>
Another example of using stringstreams is in <a class="link" href="bk01pt05ch13s05.html" title="Shrink to Fit">this howto</a>. Another example of using stringstreams is in <a class="link" href="bk01pt05ch13s05.html" title="Shrink to Fit">this howto</a>.
</p><p> There is additional information in the libstdc++-v2 info files, in </p><p> There is additional information in the libstdc++-v2 info files, in
particular “<span class="quote">info iostream</span>”. particular <span class="quote"><span class="quote">info iostream</span></span>.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id659623"></a>Little or no wide character support</h4></div></div></div><p> </p></div><div class="sect3" title="Little or no wide character support"><div class="titlepage"><div><div><h4 class="title"><a id="id442843"></a>Little or no wide character support</h4></div></div></div><p>
Classes <code class="classname">wstring</code> and Classes <code class="classname">wstring</code> and
<code class="classname">char_traits&lt;wchar_t&gt;</code> are <code class="classname">char_traits&lt;wchar_t&gt;</code> are
not supported. not supported.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id659642"></a>No templatized iostreams</h4></div></div></div><p> </p></div><div class="sect3" title="No templatized iostreams"><div class="titlepage"><div><div><h4 class="title"><a id="id442862"></a>No templatized iostreams</h4></div></div></div><p>
Classes <code class="classname">wfilebuf</code> and Classes <code class="classname">wfilebuf</code> and
<code class="classname">wstringstream</code> are not supported. <code class="classname">wstringstream</code> are not supported.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id659661"></a>Thread safety issues</h4></div></div></div><p> </p></div><div class="sect3" title="Thread safety issues"><div class="titlepage"><div><div><h4 class="title"><a id="id442881"></a>Thread safety issues</h4></div></div></div><p>
Earlier GCC releases had a somewhat different approach to Earlier GCC releases had a somewhat different approach to
threading configuration and proper compilation. Before GCC 3.0, threading configuration and proper compilation. Before GCC 3.0,
configuration of the threading model was dictated by compiler configuration of the threading model was dictated by compiler
@ -342,11 +342,11 @@ particular “<span class="quote">info iostream</span>”.
first relevant message in the thread; from there you can use first relevant message in the thread; from there you can use
"Thread Next" to move down the thread. This farm is in "Thread Next" to move down the thread. This farm is in
latest-to-oldest order. latest-to-oldest order.
</p><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
Our threading expert Loren gives a breakdown of <a class="ulink" href="http://gcc.gnu.org/ml/libstdc++/2001-10/msg00024.html" target="_top">the Our threading expert Loren gives a breakdown of <a class="ulink" href="http://gcc.gnu.org/ml/libstdc++/2001-10/msg00024.html" target="_top">the
six situations involving threads</a> for the 3.0 six situations involving threads</a> for the 3.0
release series. release series.
</p></li><li><p> </p></li><li class="listitem"><p>
<a class="ulink" href="http://gcc.gnu.org/ml/libstdc++/2001-05/msg00384.html" target="_top"> <a class="ulink" href="http://gcc.gnu.org/ml/libstdc++/2001-05/msg00384.html" target="_top">
This message</a> inspired a recent updating of issues with This message</a> inspired a recent updating of issues with
threading and the SGI STL library. It also contains some threading and the SGI STL library. It also contains some
@ -357,14 +357,14 @@ particular “<span class="quote">info iostream</span>”.
few people with access to the backup tapes have been too swamped few people with access to the backup tapes have been too swamped
with work to restore them. Many of the points have been with work to restore them. Many of the points have been
superseded anyhow.) superseded anyhow.)
</p></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.third"></a>Third</h3></div></div></div><p> The third generation GNU C++ library is called libstdc++, or </p></div></div><div class="sect2" title="Third"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.third"></a>Third</h3></div></div></div><p> The third generation GNU C++ library is called libstdc++, or
libstdc++-v3. libstdc++-v3.
</p><p>The subset commonly known as the Standard Template Library </p><p>The subset commonly known as the Standard Template Library
(chapters 23 through 25, mostly) is adapted from the final release (chapters 23 through 25, mostly) is adapted from the final release
of the SGI STL (version 3.3), with extensive changes. of the SGI STL (version 3.3), with extensive changes.
</p><p>A more formal description of the V3 goals can be found in the </p><p>A more formal description of the V3 goals can be found in the
official <a class="link" href="source_design_notes.html" title="Design Notes">design document</a>. official <a class="link" href="source_design_notes.html" title="Design Notes">design document</a>.
</p><p>Portability notes and known implementation limitations are as follows.</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id659778"></a>Pre-ISO headers moved to backwards or removed</h4></div></div></div><p> The pre-ISO C++ headers </p><p>Portability notes and known implementation limitations are as follows.</p><div class="sect3" title="Pre-ISO headers moved to backwards or removed"><div class="titlepage"><div><div><h4 class="title"><a id="id409371"></a>Pre-ISO headers moved to backwards or removed</h4></div></div></div><p> The pre-ISO C++ headers
(<code class="code">iostream.h</code>, <code class="code">defalloc.h</code> etc.) are (<code class="code">iostream.h</code>, <code class="code">defalloc.h</code> etc.) are
available, unlike previous libstdc++ versions, but inclusion available, unlike previous libstdc++ versions, but inclusion
generates a warning that you are using deprecated headers. generates a warning that you are using deprecated headers.
@ -436,7 +436,7 @@ like <code class="filename">vector.h</code> can be replaced with <code class="fi
directive <code class="code">using namespace std;</code> can be put at the global directive <code class="code">using namespace std;</code> can be put at the global
scope. This should be enough to get this code compiling, assuming the scope. This should be enough to get this code compiling, assuming the
other usage is correct. other usage is correct.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id674389"></a>Extension headers hash_map, hash_set moved to ext or backwards</h4></div></div></div><p>At this time most of the features of the SGI STL extension have been </p></div><div class="sect3" title="Extension headers hash_map, hash_set moved to ext or backwards"><div class="titlepage"><div><div><h4 class="title"><a id="id409453"></a>Extension headers hash_map, hash_set moved to ext or backwards</h4></div></div></div><p>At this time most of the features of the SGI STL extension have been
replaced by standardized libraries. replaced by standardized libraries.
In particular, the unordered_map and unordered_set containers of TR1 In particular, the unordered_map and unordered_set containers of TR1
are suitable replacement for the non-standard hash_map and hash_set are suitable replacement for the non-standard hash_map and hash_set
@ -508,18 +508,18 @@ AC_DEFUN([AC_HEADER_EXT_HASH_SET], [
AC_DEFINE(HAVE_EXT_HASH_SET,,[Define if ext/hash_set is present. ]) AC_DEFINE(HAVE_EXT_HASH_SET,,[Define if ext/hash_set is present. ])
fi fi
]) ])
</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id674492"></a>No <code class="code">ios::nocreate/ios::noreplace</code>. </pre></div><div class="sect3" title="No ios::nocreate/ios::noreplace."><div class="titlepage"><div><div><h4 class="title"><a id="id409556"></a>No <code class="code">ios::nocreate/ios::noreplace</code>.
</h4></div></div></div><p> The existence of <code class="code">ios::nocreate</code> being used for </h4></div></div></div><p> The existence of <code class="code">ios::nocreate</code> being used for
input-streams has been confirmed, most probably because the author input-streams has been confirmed, most probably because the author
thought it would be more correct to specify nocreate explicitly. So thought it would be more correct to specify nocreate explicitly. So
it can be left out for input-streams. it can be left out for input-streams.
</p><p>For output streams, “<span class="quote">nocreate</span>” is probably the default, </p><p>For output streams, <span class="quote"><span class="quote">nocreate</span></span> is probably the default,
unless you specify <code class="code">std::ios::trunc</code> ? To be safe, you can unless you specify <code class="code">std::ios::trunc</code> ? To be safe, you can
open the file for reading, check if it has been opened, and then open the file for reading, check if it has been opened, and then
decide whether you want to create/replace or not. To my knowledge, decide whether you want to create/replace or not. To my knowledge,
even older implementations support <code class="code">app</code>, <code class="code">ate</code> even older implementations support <code class="code">app</code>, <code class="code">ate</code>
and <code class="code">trunc</code> (except for <code class="code">app</code> ?). and <code class="code">trunc</code> (except for <code class="code">app</code> ?).
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id674539"></a> </p></div><div class="sect3" title="No stream::attach(int fd)"><div class="titlepage"><div><div><h4 class="title"><a id="id409604"></a>
No <code class="code">stream::attach(int fd)</code> No <code class="code">stream::attach(int fd)</code>
</h4></div></div></div><p> </h4></div></div></div><p>
Phil Edwards writes: It was considered and rejected for the ISO Phil Edwards writes: It was considered and rejected for the ISO
@ -542,7 +542,7 @@ No <code class="code">stream::attach(int fd)</code>
For another example of this, refer to For another example of this, refer to
<a class="ulink" href="http://www.josuttis.com/cppcode/fdstream.html" target="_top">fdstream example</a> <a class="ulink" href="http://www.josuttis.com/cppcode/fdstream.html" target="_top">fdstream example</a>
by Nicolai Josuttis. by Nicolai Josuttis.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id674603"></a> </p></div><div class="sect3" title="Support for C++98 dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id450867"></a>
Support for C++98 dialect. Support for C++98 dialect.
</h4></div></div></div><p>Check for complete library coverage of the C++1998/2003 standard. </h4></div></div></div><p>Check for complete library coverage of the C++1998/2003 standard.
</p><pre class="programlisting"> </p><pre class="programlisting">
@ -610,7 +610,7 @@ AC_DEFUN([AC_HEADER_STDCXX_98], [
AC_DEFINE(STDCXX_98_HEADERS,,[Define if ISO C++ 1998 header files are present. ]) AC_DEFINE(STDCXX_98_HEADERS,,[Define if ISO C++ 1998 header files are present. ])
fi fi
]) ])
</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id674631"></a> </pre></div><div class="sect3" title="Support for C++TR1 dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id450895"></a>
Support for C++TR1 dialect. Support for C++TR1 dialect.
</h4></div></div></div><p>Check for library coverage of the TR1 standard. </h4></div></div></div><p>Check for library coverage of the TR1 standard.
</p><pre class="programlisting"> </p><pre class="programlisting">
@ -687,7 +687,7 @@ AC_DEFUN([AC_HEADER_TR1_UNORDERED_SET], [
AC_DEFINE(HAVE_TR1_UNORDERED_SET,,[Define if tr1/unordered_set is present. ]) AC_DEFINE(HAVE_TR1_UNORDERED_SET,,[Define if tr1/unordered_set is present. ])
fi fi
]) ])
</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id675096"></a> </pre></div><div class="sect3" title="Support for C++0x dialect."><div class="titlepage"><div><div><h4 class="title"><a id="id450938"></a>
Support for C++0x dialect. Support for C++0x dialect.
</h4></div></div></div><p>Check for baseline language coverage in the compiler for the C++0xstandard. </h4></div></div></div><p>Check for baseline language coverage in the compiler for the C++0xstandard.
</p><pre class="programlisting"> </p><pre class="programlisting">
@ -899,27 +899,27 @@ AC_DEFUN([AC_HEADER_UNORDERED_SET], [
AC_DEFINE(HAVE_UNORDERED_SET,,[Define if unordered_set is present. ]) AC_DEFINE(HAVE_UNORDERED_SET,,[Define if unordered_set is present. ])
fi fi
]) ])
</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id675173"></a> </pre></div><div class="sect3" title="Container::iterator_type is not necessarily Container::value_type*"><div class="titlepage"><div><div><h4 class="title"><a id="id451016"></a>
Container::iterator_type is not necessarily Container::value_type* Container::iterator_type is not necessarily Container::value_type*
</h4></div></div></div><p> </h4></div></div></div><p>
This is a change in behavior from the previous version. Now, most This is a change in behavior from the previous version. Now, most
<span class="type">iterator_type</span> typedefs in container classes are POD <span class="type">iterator_type</span> typedefs in container classes are POD
objects, not <span class="type">value_type</span> pointers. objects, not <span class="type">value_type</span> pointers.
</p></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id675202"></a><p>[<abbr class="abbrev"> </p></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry" title="Migrating to GCC 4.1"><a id="id451045"></a><p>[<abbr class="abbrev">
kegel41 kegel41
</abbr>] <span class="title"><i> </abbr>] <span class="title"><i>
Migrating to GCC 4.1 Migrating to GCC 4.1
</i>. </span><span class="author"><span class="firstname">Dan</span> <span class="surname">Kegel</span>. </span><span class="biblioid"> </i>. </span><span class="author"><span class="firstname">Dan</span> <span class="surname">Kegel</span>. </span><span class="biblioid">
<a class="ulink" href="http://www.kegel.com/gcc/gcc4.html" target="_top"> <a class="ulink" href="http://www.kegel.com/gcc/gcc4.html" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id675235"></a><p>[<abbr class="abbrev"> . </span></p></div><div class="biblioentry" title="Building the Whole Debian Archive with GCC 4.1: A Summary"><a id="id451077"></a><p>[<abbr class="abbrev">
kegel41 kegel41
</abbr>] <span class="title"><i> </abbr>] <span class="title"><i>
Building the Whole Debian Archive with GCC 4.1: A Summary Building the Whole Debian Archive with GCC 4.1: A Summary
</i>. </span><span class="author"><span class="firstname">Martin</span> <span class="surname">Michlmayr</span>. </span><span class="biblioid"> </i>. </span><span class="author"><span class="firstname">Martin</span> <span class="surname">Michlmayr</span>. </span><span class="biblioid">
<a class="ulink" href="http://lists.debian.org/debian-gcc/2006/03/msg00405.html" target="_top"> <a class="ulink" href="http://lists.debian.org/debian-gcc/2006/03/msg00405.html" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id675268"></a><p>[<abbr class="abbrev"> . </span></p></div><div class="biblioentry" title="Migration guide for GCC-3.2"><a id="id451110"></a><p>[<abbr class="abbrev">
lbl32 lbl32
</abbr>] <span class="title"><i> </abbr>] <span class="title"><i>
Migration guide for GCC-3.2 Migration guide for GCC-3.2

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>bitmap_allocator</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; allocator&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_allocators.html" title="Chapter 33. Allocators" /><link rel="prev" href="ext_allocators.html" title="Chapter 33. Allocators" /><link rel="next" href="ext_containers.html" title="Chapter 34. Containers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">bitmap_allocator</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_allocators.html">Prev</a> </td><th width="60%" align="center">Chapter 33. Allocators</th><td width="20%" align="right"> <a accesskey="n" href="ext_containers.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.allocator.bitmap"></a>bitmap_allocator</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>bitmap_allocator</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; allocator&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_allocators.html" title="Chapter 33. Allocators" /><link rel="prev" href="ext_allocators.html" title="Chapter 33. Allocators" /><link rel="next" href="ext_containers.html" title="Chapter 34. Containers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">bitmap_allocator</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_allocators.html">Prev</a> </td><th width="60%" align="center">Chapter 33. Allocators</th><td width="20%" align="right"> <a accesskey="n" href="ext_containers.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="bitmap_allocator"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.allocator.bitmap"></a>bitmap_allocator</h2></div></div></div><p>
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.bitmap.design"></a>Design</h3></div></div></div><p> </p><div class="sect2" title="Design"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.bitmap.design"></a>Design</h3></div></div></div><p>
As this name suggests, this allocator uses a bit-map to keep track As this name suggests, this allocator uses a bit-map to keep track
of the used and unused memory locations for it's book-keeping of the used and unused memory locations for it's book-keeping
purposes. purposes.
@ -27,7 +27,7 @@
Mutex Protection around every allocation/deallocation. The state Mutex Protection around every allocation/deallocation. The state
of the macro is picked up automatically from the gthr abstraction of the macro is picked up automatically from the gthr abstraction
layer. layer.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.bitmap.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.free_list_store"></a>Free List Store</h4></div></div></div><p> </p></div><div class="sect2" title="Implementation"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.bitmap.impl"></a>Implementation</h3></div></div></div><div class="sect3" title="Free List Store"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.free_list_store"></a>Free List Store</h4></div></div></div><p>
The Free List Store (referred to as FLS for the remaining part of this The Free List Store (referred to as FLS for the remaining part of this
document) is the Global memory pool that is shared by all instances of document) is the Global memory pool that is shared by all instances of
the bitmapped allocator instantiated for any type. This maintains a the bitmapped allocator instantiated for any type. This maintains a
@ -65,17 +65,17 @@
this internal fragmentation has to be decided by this function. I this internal fragmentation has to be decided by this function. I
can see 3 possibilities right now. Please add more as and when you can see 3 possibilities right now. Please add more as and when you
find better strategies. find better strategies.
</p><div class="orderedlist"><ol type="1"><li><p>Equal size check. Return true only when the 2 blocks are of equal </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Equal size check. Return true only when the 2 blocks are of equal
size.</p></li><li><p>Difference Threshold: Return true only when the _block_size is size.</p></li><li class="listitem"><p>Difference Threshold: Return true only when the _block_size is
greater than or equal to the _required_size, and if the _BS is &gt; _RS greater than or equal to the _required_size, and if the _BS is &gt; _RS
by a difference of less than some THRESHOLD value, then return true, by a difference of less than some THRESHOLD value, then return true,
else return false. </p></li><li><p>Percentage Threshold. Return true only when the _block_size is else return false. </p></li><li class="listitem"><p>Percentage Threshold. Return true only when the _block_size is
greater than or equal to the _required_size, and if the _BS is &gt; _RS greater than or equal to the _required_size, and if the _BS is &gt; _RS
by a percentage of less than some THRESHOLD value, then return true, by a percentage of less than some THRESHOLD value, then return true,
else return false.</p></li></ol></div><p> else return false.</p></li></ol></div><p>
Currently, (3) is being used with a value of 36% Maximum wastage per Currently, (3) is being used with a value of 36% Maximum wastage per
Super Block. Super Block.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.super_block"></a>Super Block</h4></div></div></div><p> </p></div><div class="sect3" title="Super Block"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.super_block"></a>Super Block</h4></div></div></div><p>
A super block is the block of memory acquired from the FLS from A super block is the block of memory acquired from the FLS from
which the bitmap allocator carves out memory for single objects which the bitmap allocator carves out memory for single objects
and satisfies the user's requests. These super blocks come in and satisfies the user's requests. These super blocks come in
@ -90,7 +90,7 @@ else return false.</p></li></ol></div><p>
The super block is contained in the FLS, and the FLS is responsible for The super block is contained in the FLS, and the FLS is responsible for
getting / returning Super Bocks to and from the OS using operator new getting / returning Super Bocks to and from the OS using operator new
as defined by the C++ standard. as defined by the C++ standard.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.super_block_data"></a>Super Block Data Layout</h4></div></div></div><p> </p></div><div class="sect3" title="Super Block Data Layout"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.super_block_data"></a>Super Block Data Layout</h4></div></div></div><p>
Each Super Block will be of some size that is a multiple of the Each Super Block will be of some size that is a multiple of the
number of Bits Per Block. Typically, this value is chosen as number of Bits Per Block. Typically, this value is chosen as
Bits_Per_Byte x sizeof(size_t). On an x86 system, this gives the Bits_Per_Byte x sizeof(size_t). On an x86 system, this gives the
@ -103,7 +103,7 @@ else return false.</p></li></ol></div><p>
</p><p> </p><p>
Consider a block of size 64 ints. In memory, it would look like this: Consider a block of size 64 ints. In memory, it would look like this:
(assume a 32-bit system where, size_t is a 32-bit entity). (assume a 32-bit system where, size_t is a 32-bit entity).
</p><div class="table"><a id="id730908"></a><p class="title"><b>Table 33.1. Bitmap Allocator Memory Map</b></p><div class="table-contents"><table summary="Bitmap Allocator Memory Map" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left">268</td><td align="left">0</td><td align="left">4294967295</td><td align="left">4294967295</td><td align="left">Data -&gt; Space for 64 ints</td></tr></tbody></table></div></div><br class="table-break" /><p> </p><div class="table"><a id="id530373"></a><p class="title"><b>Table 33.1. Bitmap Allocator Memory Map</b></p><div class="table-contents"><table summary="Bitmap Allocator Memory Map" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left">268</td><td align="left">0</td><td align="left">4294967295</td><td align="left">4294967295</td><td align="left">Data -&gt; Space for 64 ints</td></tr></tbody></table></div></div><br class="table-break" /><p>
The first Column(268) represents the size of the Block in bytes as The first Column(268) represents the size of the Block in bytes as
seen by the Bitmap Allocator. Internally, a global free list is seen by the Bitmap Allocator. Internally, a global free list is
used to keep track of the free blocks used and given back by the used to keep track of the free blocks used and given back by the
@ -130,7 +130,7 @@ else return false.</p></li></ol></div><p>
The 3rd 4x2 is size of the bitmap itself, which is the size of 32-bits The 3rd 4x2 is size of the bitmap itself, which is the size of 32-bits
x 2, x 2,
which is 8-bytes, or 2 x sizeof(size_t). which is 8-bytes, or 2 x sizeof(size_t).
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.max_wasted"></a>Maximum Wasted Percentage</h4></div></div></div><p> </p></div><div class="sect3" title="Maximum Wasted Percentage"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.max_wasted"></a>Maximum Wasted Percentage</h4></div></div></div><p>
This has nothing to do with the algorithm per-se, This has nothing to do with the algorithm per-se,
only with some vales that must be chosen correctly to ensure that the only with some vales that must be chosen correctly to ensure that the
allocator performs well in a real word scenario, and maintains a good allocator performs well in a real word scenario, and maintains a good
@ -155,29 +155,29 @@ For map/multimap: k = 12, and c = 4 (int and double), we get: 37.524%
</p><p> </p><p>
Thus, knowing these values, and based on the sizeof(value_type), we may Thus, knowing these values, and based on the sizeof(value_type), we may
create a function that returns the Max_Wastage_Percentage for us to use. create a function that returns the Max_Wastage_Percentage for us to use.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.allocate"></a><code class="function">allocate</code></h4></div></div></div><p> </p></div><div class="sect3" title="allocate"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.allocate"></a><code class="function">allocate</code></h4></div></div></div><p>
The allocate function is specialized for single object allocation The allocate function is specialized for single object allocation
ONLY. Thus, ONLY if n == 1, will the bitmap_allocator's ONLY. Thus, ONLY if n == 1, will the bitmap_allocator's
specialized algorithm be used. Otherwise, the request is satisfied specialized algorithm be used. Otherwise, the request is satisfied
directly by calling operator new. directly by calling operator new.
</p><p> </p><p>
Suppose n == 1, then the allocator does the following: Suppose n == 1, then the allocator does the following:
</p><div class="orderedlist"><ol type="1"><li><p> </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
Checks to see whether a free block exists somewhere in a region Checks to see whether a free block exists somewhere in a region
of memory close to the last satisfied request. If so, then that of memory close to the last satisfied request. If so, then that
block is marked as allocated in the bit map and given to the block is marked as allocated in the bit map and given to the
user. If not, then (2) is executed. user. If not, then (2) is executed.
</p></li><li><p> </p></li><li class="listitem"><p>
Is there a free block anywhere after the current block right Is there a free block anywhere after the current block right
up to the end of the memory that we have? If so, that block is up to the end of the memory that we have? If so, that block is
found, and the same procedure is applied as above, and found, and the same procedure is applied as above, and
returned to the user. If not, then (3) is executed. returned to the user. If not, then (3) is executed.
</p></li><li><p> </p></li><li class="listitem"><p>
Is there any block in whatever region of memory that we own Is there any block in whatever region of memory that we own
free? This is done by checking free? This is done by checking
</p><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
The use count for each super block, and if that fails then The use count for each super block, and if that fails then
</p></li><li><p> </p></li><li class="listitem"><p>
The individual bit-maps for each super block. The individual bit-maps for each super block.
</p></li></ul></div><p> </p></li></ul></div><p>
Note: Here we are never touching any of the memory that the Note: Here we are never touching any of the memory that the
@ -186,21 +186,21 @@ For map/multimap: k = 12, and c = 4 (int and double), we get: 37.524%
misses. If this succeeds then we apply the same procedure on misses. If this succeeds then we apply the same procedure on
that bit-map as (1), and return that block of memory to the that bit-map as (1), and return that block of memory to the
user. However, if this process fails, then we resort to (4). user. However, if this process fails, then we resort to (4).
</p></li><li><p> </p></li><li class="listitem"><p>
This process involves Refilling the internal exponentially This process involves Refilling the internal exponentially
growing memory pool. The said effect is achieved by calling growing memory pool. The said effect is achieved by calling
_S_refill_pool which does the following: _S_refill_pool which does the following:
</p><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
Gets more memory from the Global Free List of the Required Gets more memory from the Global Free List of the Required
size. size.
</p></li><li><p> </p></li><li class="listitem"><p>
Adjusts the size for the next call to itself. Adjusts the size for the next call to itself.
</p></li><li><p> </p></li><li class="listitem"><p>
Writes the appropriate headers in the bit-maps. Writes the appropriate headers in the bit-maps.
</p></li><li><p> </p></li><li class="listitem"><p>
Sets the use count for that super-block just allocated to 0 Sets the use count for that super-block just allocated to 0
(zero). (zero).
</p></li><li><p> </p></li><li class="listitem"><p>
All of the above accounts to maintaining the basic invariant All of the above accounts to maintaining the basic invariant
for the allocator. If the invariant is maintained, we are for the allocator. If the invariant is maintained, we are
sure that all is well. Now, the same process is applied on sure that all is well. Now, the same process is applied on
@ -210,13 +210,13 @@ For map/multimap: k = 12, and c = 4 (int and double), we get: 37.524%
Thus, you can clearly see that the allocate function is nothing but a Thus, you can clearly see that the allocate function is nothing but a
combination of the next-fit and first-fit algorithm optimized ONLY for combination of the next-fit and first-fit algorithm optimized ONLY for
single object allocations. single object allocations.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.deallocate"></a><code class="function">deallocate</code></h4></div></div></div><p> </p></div><div class="sect3" title="deallocate"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.deallocate"></a><code class="function">deallocate</code></h4></div></div></div><p>
The deallocate function again is specialized for single objects ONLY. The deallocate function again is specialized for single objects ONLY.
For all n belonging to &gt; 1, the operator delete is called without For all n belonging to &gt; 1, the operator delete is called without
further ado, and the deallocate function returns. further ado, and the deallocate function returns.
</p><p> </p><p>
However for n == 1, a series of steps are performed: However for n == 1, a series of steps are performed:
</p><div class="orderedlist"><ol type="1"><li><p> </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
We first need to locate that super-block which holds the memory We first need to locate that super-block which holds the memory
location given to us by the user. For that purpose, we maintain location given to us by the user. For that purpose, we maintain
a static variable _S_last_dealloc_index, which holds the index a static variable _S_last_dealloc_index, which holds the index
@ -227,7 +227,7 @@ single object allocations.
the check for belongs_to succeeds, then we determine the bit-map the check for belongs_to succeeds, then we determine the bit-map
for the given pointer, and locate the index into that bit-map, for the given pointer, and locate the index into that bit-map,
and mark that bit as free by setting it. and mark that bit as free by setting it.
</p></li><li><p> </p></li><li class="listitem"><p>
If the _S_last_dealloc_index does not point to the memory block If the _S_last_dealloc_index does not point to the memory block
that we're looking for, then we do a linear search on the block that we're looking for, then we do a linear search on the block
stored in the vector of Block Pairs. This vector in code is stored in the vector of Block Pairs. This vector in code is
@ -241,7 +241,7 @@ single object allocations.
the vector. While doing this, we also make sure that the basic the vector. While doing this, we also make sure that the basic
invariant is maintained by making sure that _S_last_request and invariant is maintained by making sure that _S_last_request and
_S_last_dealloc_index point to valid locations within the vector. _S_last_dealloc_index point to valid locations within the vector.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.questions"></a>Questions</h4></div></div></div><div class="sect4" lang="en" xml:lang="en"><div class="titlepage"><div><div><h5 class="title"><a id="bitmap.impl.question.1"></a>1</h5></div></div></div><p> </p></div><div class="sect3" title="Questions"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.questions"></a>Questions</h4></div></div></div><div class="sect4" title="1"><div class="titlepage"><div><div><h5 class="title"><a id="bitmap.impl.question.1"></a>1</h5></div></div></div><p>
Q1) The "Data Layout" section is Q1) The "Data Layout" section is
cryptic. I have no idea of what you are trying to say. Layout of what? cryptic. I have no idea of what you are trying to say. Layout of what?
The free-list? Each bitmap? The Super Block? The free-list? Each bitmap? The Super Block?
@ -251,7 +251,7 @@ size. In the example, a super block of size 32 x 1 is taken. The
general formula for calculating the size of a super block is general formula for calculating the size of a super block is
32 x sizeof(value_type) x 2^n, where n ranges from 0 to 32 for 32-bit 32 x sizeof(value_type) x 2^n, where n ranges from 0 to 32 for 32-bit
systems. systems.
</p></div><div class="sect4" lang="en" xml:lang="en"><div class="titlepage"><div><div><h5 class="title"><a id="bitmap.impl.question.2"></a>2</h5></div></div></div><p> </p></div><div class="sect4" title="2"><div class="titlepage"><div><div><h5 class="title"><a id="bitmap.impl.question.2"></a>2</h5></div></div></div><p>
And since I just mentioned the And since I just mentioned the
term `each bitmap', what in the world is meant by it? What does each term `each bitmap', what in the world is meant by it? What does each
bitmap manage? How does it relate to the super block? Is the Super bitmap manage? How does it relate to the super block? Is the Super
@ -268,7 +268,7 @@ Block a bitmap as well?
blocks' status. Each bit-map is made up of a number of size_t, blocks' status. Each bit-map is made up of a number of size_t,
whose exact number for a super-block of a given size I have just whose exact number for a super-block of a given size I have just
mentioned. mentioned.
</p></div><div class="sect4" lang="en" xml:lang="en"><div class="titlepage"><div><div><h5 class="title"><a id="bitmap.impl.question.3"></a>3</h5></div></div></div><p> </p></div><div class="sect4" title="3"><div class="titlepage"><div><div><h5 class="title"><a id="bitmap.impl.question.3"></a>3</h5></div></div></div><p>
How do the allocate and deallocate functions work in regard to How do the allocate and deallocate functions work in regard to
bitmaps? bitmaps?
</p><p> </p><p>
@ -297,15 +297,15 @@ Block a bitmap as well?
</p><p> </p><p>
The bit-map now looks like this: The bit-map now looks like this:
1111111111111111111111111111111111111111111111111111111111111110 1111111111111111111111111111111111111111111111111111111111111110
</p></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.locality"></a>Locality</h4></div></div></div><p> </p></div></div><div class="sect3" title="Locality"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.locality"></a>Locality</h4></div></div></div><p>
Another issue would be whether to keep the all bitmaps in a Another issue would be whether to keep the all bitmaps in a
separate area in memory, or to keep them near the actual blocks separate area in memory, or to keep them near the actual blocks
that will be given out or allocated for the client. After some that will be given out or allocated for the client. After some
testing, I've decided to keep these bitmaps close to the actual testing, I've decided to keep these bitmaps close to the actual
blocks. This will help in 2 ways. blocks. This will help in 2 ways.
</p><div class="orderedlist"><ol type="1"><li><p>Constant time access for the bitmap themselves, since no kind of </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Constant time access for the bitmap themselves, since no kind of
look up will be needed to find the correct bitmap list or it's look up will be needed to find the correct bitmap list or it's
equivalent.</p></li><li><p>And also this would preserve the cache as far as possible.</p></li></ol></div><p> equivalent.</p></li><li class="listitem"><p>And also this would preserve the cache as far as possible.</p></li></ol></div><p>
So in effect, this kind of an allocator might prove beneficial from a So in effect, this kind of an allocator might prove beneficial from a
purely cache point of view. But this allocator has been made to try and purely cache point of view. But this allocator has been made to try and
roll out the defects of the node_allocator, wherein the nodes get roll out the defects of the node_allocator, wherein the nodes get
@ -314,7 +314,7 @@ equivalent.</p></li><li><p>And also this would preserve the cache as far as poss
new_allocator's book keeping overhead is too much for small objects and new_allocator's book keeping overhead is too much for small objects and
single object allocations, though it preserves the locality of blocks single object allocations, though it preserves the locality of blocks
very well when they are returned back to the allocator. very well when they are returned back to the allocator.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.grow_policy"></a>Overhead and Grow Policy</h4></div></div></div><p> </p></div><div class="sect3" title="Overhead and Grow Policy"><div class="titlepage"><div><div><h4 class="title"><a id="bitmap.impl.grow_policy"></a>Overhead and Grow Policy</h4></div></div></div><p>
Expected overhead per block would be 1 bit in memory. Also, once Expected overhead per block would be 1 bit in memory. Also, once
the address of the free list has been found, the cost for the address of the free list has been found, the cost for
allocation/deallocation would be negligible, and is supposed to be allocation/deallocation would be negligible, and is supposed to be

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>bitset</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="associative.html" title="Chapter 17. Associative" /><link rel="prev" href="associative.html" title="Chapter 17. Associative" /><link rel="next" href="containers_and_c.html" title="Chapter 18. Interacting with C" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">bitset</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="associative.html">Prev</a> </td><th width="60%" align="center">Chapter 17. Associative</th><td width="20%" align="right"> <a accesskey="n" href="containers_and_c.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="containers.associative.bitset"></a>bitset</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="associative.bitset.size_variable"></a>Size Variable</h3></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>bitset</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="associative.html" title="Chapter 17. Associative" /><link rel="prev" href="associative.html" title="Chapter 17. Associative" /><link rel="next" href="containers_and_c.html" title="Chapter 18. Interacting with C" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">bitset</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="associative.html">Prev</a> </td><th width="60%" align="center">Chapter 17. Associative</th><td width="20%" align="right"> <a accesskey="n" href="containers_and_c.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="bitset"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="containers.associative.bitset"></a>bitset</h2></div></div></div><div class="sect2" title="Size Variable"><div class="titlepage"><div><div><h3 class="title"><a id="associative.bitset.size_variable"></a>Size Variable</h3></div></div></div><p>
No, you cannot write code of the form No, you cannot write code of the form
</p><pre class="programlisting"> </p><pre class="programlisting">
#include &lt;bitset&gt; #include &lt;bitset&gt;
@ -18,7 +18,7 @@
There are a couple of ways to handle this kind of thing. Please 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><div class="itemizedlist"><ul type="disc"><li><p>A very large N in <code class="code">bitset&lt;N&gt;</code>.</p></li><li><p>A container&lt;bool&gt;.</p></li><li><p>Extremely weird solutions.</p></li></ul></div><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>A very large N in <code class="code">bitset&lt;N&gt;</code>.</p></li><li class="listitem"><p>A container&lt;bool&gt;.</p></li><li class="listitem"><p>Extremely weird solutions.</p></li></ul></div><p>
<span class="emphasis"><em>A very large N in <span class="emphasis"><em>A very large N in
<code class="code">bitset&lt;N&gt;</code>.  </em></span> It has been <code class="code">bitset&lt;N&gt;</code>.  </em></span> It has been
pointed out a few times in newsgroups that N bits only takes up pointed out a few times in newsgroups that N bits only takes up
@ -28,10 +28,10 @@
housekeeping info; it is known at compile time exactly how large housekeeping info; it is known at compile time exactly how large
the set is) will hold over four million bits. If you're using the set is) will hold over four million bits. If you're using
those bits as status flags (e.g., those bits as status flags (e.g.,
<span class="quote">changed</span>”/“<span class="quote">unchanged</span>” flags), that's a <span class="quote"><span class="quote">changed</span></span>/<span class="quote"><span class="quote">unchanged</span></span> flags), that's a
<span class="emphasis"><em>lot</em></span> of state. <span class="emphasis"><em>lot</em></span> of state.
</p><p> </p><p>
You can then keep track of the “<span class="quote">maximum bit used</span> You can then keep track of the <span class="quote"><span class="quote">maximum bit used</span></span>
during some testing runs on representative data, make note of how during some testing runs on representative data, make note of how
many of those bits really need to be there, and then reduce N to many of those bits really need to be there, and then reduce N to
a smaller number. Leave some extra space, of course. (If you a smaller number. Leave some extra space, of course. (If you
@ -85,21 +85,21 @@
</p><p> </p><p>
Also note that the implementation of bitset used in libstdc++ has Also note that the implementation of bitset used in libstdc++ has
<a class="link" href="bk01pt12ch34s02.html" title="HP/SGI">some extensions</a>. <a class="link" href="bk01pt12ch34s02.html" title="HP/SGI">some extensions</a>.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="associative.bitset.type_string"></a>Type String</h3></div></div></div><p> </p></div><div class="sect2" title="Type String"><div class="titlepage"><div><div><h3 class="title"><a id="associative.bitset.type_string"></a>Type String</h3></div></div></div><p>
</p><p> </p><p>
Bitmasks do not take char* nor const char* arguments in their 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
about the problem: follow the library's “<span class="quote">Links</span>” from about the problem: follow the library's <span class="quote"><span class="quote">Links</span></span> from
the homepage, and from the C++ information “<span class="quote">defect the homepage, and from the C++ information <span class="quote"><span class="quote">defect
reflector</span>” link, select the library issues list. Issue reflector</span></span> link, select the library issues list. Issue
number 116 describes the problem. number 116 describes the problem.
</p><p> </p><p>
For now you can simply make a temporary string object using the For now you can simply make a temporary string object using the
constructor expression: constructor expression:
</p><pre class="programlisting"> </p><pre class="programlisting">
std::bitset&lt;5&gt; b ( std::string(“<span class="quote">10110</span>”) ); std::bitset&lt;5&gt; b ( std::string(<span class="quote"><span class="quote">10110</span></span>) );
</pre><p> </pre><p>
instead of instead of
</p><pre class="programlisting"> </p><pre class="programlisting">
std::bitset&lt;5&gt; b ( “<span class="quote">10110</span>” ); // invalid std::bitset&lt;5&gt; b ( <span class="quote"><span class="quote">10110</span></span> ); // invalid
</pre></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="associative.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="associative.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="containers_and_c.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 17. Associative </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 18. Interacting with C</td></tr></table></div></body></html> </pre></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="associative.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="associative.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="containers_and_c.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 17. Associative </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 18. Interacting with C</td></tr></table></div></body></html>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Index</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="appendix_gfdl.html" title="Appendix E. GNU Free Documentation License" /><link rel="next" href="../bk02.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Index</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_gfdl.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="../bk02.html">Next</a></td></tr></table><hr /></div><div class="index"><div class="titlepage"><div><div><h2 class="title"><a id="id692397"></a>Index</h2></div></div></div><div class="index"><div class="indexdiv"><h3>A</h3><dl><dt>Algorithms, <a class="indexterm" href="algorithms.html"> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Index</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="appendix_gfdl.html" title="Appendix E. GNU Free Documentation License" /><link rel="next" href="../bk02.html" title="" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Index</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_gfdl.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="../bk02.html">Next</a></td></tr></table><hr /></div><div class="index" title="Index"><div class="titlepage"><div><div><h2 class="title"><a id="id515964"></a>Index</h2></div></div></div><div class="index"><div class="indexdiv"><h3>A</h3><dl><dt>Algorithms, <a class="indexterm" href="algorithms.html">
Algorithms Algorithms
</a></dt><dt>Appendix</dt><dd><dl><dt>Contributing, <a class="indexterm" href="appendix_contributing.html"> </a></dt><dt>Appendix</dt><dd><dl><dt>Contributing, <a class="indexterm" href="appendix_contributing.html">
@ -42,7 +42,10 @@
</a></dt><dt>Support, <a class="indexterm" href="support.html"> </a></dt><dt>Support, <a class="indexterm" href="support.html">
Support Support
</a></dt></dl></div><div class="indexdiv"><h3>U</h3><dl><dt>Utilities, <a class="indexterm" href="utilities.html"> </a></dt></dl></div><div class="indexdiv"><h3>T</h3><dl><dt>Test</dt><dd><dl><dt>Exception Safety, <a class="indexterm" href="test.html#test.exception.safety">
Qualifying Exception Safety Guarantees
</a></dt></dl></dd></dl></div><div class="indexdiv"><h3>U</h3><dl><dt>Utilities, <a class="indexterm" href="utilities.html">
Utilities Utilities
</a></dt></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="appendix_gfdl.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="../bk02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix E. GNU Free Documentation License </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html> </a></dt></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="appendix_gfdl.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="../bk02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix E. GNU Free Documentation License </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Numeric Properties</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="fundamental_types.html" title="Chapter 4. Types" /><link rel="prev" href="fundamental_types.html" title="Chapter 4. Types" /><link rel="next" href="bk01pt02ch04s03.html" title="NULL" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Numeric Properties</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="fundamental_types.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Types</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt02ch04s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.support.types.numeric_limits"></a>Numeric Properties</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Numeric Properties</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="fundamental_types.html" title="Chapter 4. Types" /><link rel="prev" href="fundamental_types.html" title="Chapter 4. Types" /><link rel="next" href="bk01pt02ch04s03.html" title="NULL" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Numeric Properties</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="fundamental_types.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Types</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt02ch04s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Numeric Properties"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.support.types.numeric_limits"></a>Numeric Properties</h2></div></div></div><p>
The header <code class="filename">limits</code> defines The header <code class="filename">limits</code> defines
traits classes to give access to various implementation traits classes to give access to various implementation
defined-aspects of the fundamental types. The traits classes -- defined-aspects of the fundamental types. The traits classes --

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>NULL</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="fundamental_types.html" title="Chapter 4. Types" /><link rel="prev" href="bk01pt02ch04s02.html" title="Numeric Properties" /><link rel="next" href="dynamic_memory.html" title="Chapter 5. Dynamic Memory" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">NULL</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt02ch04s02.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Types</th><td width="20%" align="right"> <a accesskey="n" href="dynamic_memory.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.support.types.null"></a>NULL</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>NULL</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="fundamental_types.html" title="Chapter 4. Types" /><link rel="prev" href="bk01pt02ch04s02.html" title="Numeric Properties" /><link rel="next" href="dynamic_memory.html" title="Chapter 5. Dynamic Memory" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">NULL</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt02ch04s02.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Types</th><td width="20%" align="right"> <a accesskey="n" href="dynamic_memory.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="NULL"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.support.types.null"></a>NULL</h2></div></div></div><p>
The only change that might affect people is the type of The only change that might affect people is the type of
<code class="constant">NULL</code>: while it is required to be a macro, <code class="constant">NULL</code>: while it is required to be a macro,
the definition of that macro is <span class="emphasis"><em>not</em></span> allowed the definition of that macro is <span class="emphasis"><em>not</em></span> allowed
@ -12,7 +12,7 @@
<span class="command"><strong>g++</strong></span>. <span class="command"><strong>g++</strong></span>.
</p><p> </p><p>
The biggest problem of #defining <code class="constant">NULL</code> to be The biggest problem of #defining <code class="constant">NULL</code> to be
something like “<span class="quote">0L</span>” is that the compiler will view something like <span class="quote"><span class="quote">0L</span></span> is that the compiler will view
that as a long integer before it views it as a pointer, so that as a long integer before it views it as a pointer, so
overloading won't do what you expect. (This is why overloading won't do what you expect. (This is why
<span class="command"><strong>g++</strong></span> has a magic extension, so that <span class="command"><strong>g++</strong></span> has a magic extension, so that

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="support.html" title="Part II.  Support" /><link rel="prev" href="support.html" title="Part II.  Support" /><link rel="next" href="fundamental_types.html" title="Chapter 4. Types" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="support.html">Prev</a> </td><th width="60%" align="center">Part II.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="support.html" title="Part II.  Support" /><link rel="prev" href="support.html" title="Part II.  Support" /><link rel="next" href="fundamental_types.html" title="Chapter 4. Types" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="support.html">Prev</a> </td><th width="60%" align="center">Part II. 
Support Support
</th><td width="20%" align="right"> <a accesskey="n" href="fundamental_types.html">Next</a></td></tr></table><hr /></div><div class="preface" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id650354"></a></h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="fundamental_types.html">Next</a></td></tr></table><hr /></div><div class="preface"><div class="titlepage"><div><div><h2 class="title"><a id="id507716"></a></h2></div></div></div><p>
This part deals with the functions called and objects created This part deals with the functions called and objects created
automatically during the course of a program's existence. automatically during the course of a program's existence.
</p><p> </p><p>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Adding Data to Exceptions</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="exceptions.html" title="Chapter 7. Exceptions" /><link rel="prev" href="exceptions.html" title="Chapter 7. Exceptions" /><link rel="next" href="bk01pt03ch08.html" title="Chapter 8. Concept Checking" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Adding Data to Exceptions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="exceptions.html">Prev</a> </td><th width="60%" align="center">Chapter 7. Exceptions</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt03ch08.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.diagnostics.exceptions.data"></a>Adding Data to Exceptions</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Adding Data to Exceptions</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="exceptions.html" title="Chapter 7. Exceptions" /><link rel="prev" href="exceptions.html" title="Chapter 7. Exceptions" /><link rel="next" href="bk01pt03ch08.html" title="Chapter 8. Concept Checking" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Adding Data to Exceptions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="exceptions.html">Prev</a> </td><th width="60%" align="center">Chapter 7. Exceptions</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt03ch08.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Adding Data to Exceptions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.diagnostics.exceptions.data"></a>Adding Data to Exceptions</h2></div></div></div><p>
The standard exception classes carry with them a single string as The standard exception classes carry with them a single string as
data (usually describing what went wrong or where the 'throw' took data (usually describing what went wrong or where the 'throw' took
place). It's good to remember that you can add your own data to place). It's good to remember that you can add your own data to

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 8. Concept Checking</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="diagnostics.html" title="Part III.  Diagnostics" /><link rel="prev" href="bk01pt03ch07s02.html" title="Adding Data to Exceptions" /><link rel="next" href="utilities.html" title="Part IV.  Utilities" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 8. Concept Checking</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt03ch07s02.html">Prev</a> </td><th width="60%" align="center">Part III.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 8. Concept Checking</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="diagnostics.html" title="Part III.  Diagnostics" /><link rel="prev" href="bk01pt03ch07s02.html" title="Adding Data to Exceptions" /><link rel="next" href="utilities.html" title="Part IV.  Utilities" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 8. Concept Checking</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt03ch07s02.html">Prev</a> </td><th width="60%" align="center">Part III. 
Diagnostics Diagnostics
</th><td width="20%" align="right"> <a accesskey="n" href="utilities.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.diagnostics.concept_checking"></a>Chapter 8. Concept Checking</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="utilities.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 8. Concept Checking"><div class="titlepage"><div><div><h2 class="title"><a id="manual.diagnostics.concept_checking"></a>Chapter 8. Concept Checking</h2></div></div></div><p>
In 1999, SGI added “<span class="quote">concept checkers</span>” to their In 1999, SGI added <span class="quote"><span class="quote">concept checkers</span></span> to their
implementation of the STL: code which checked the template implementation of the STL: code which checked the template
parameters of instantiated pieces of the STL, in order to insure parameters of instantiated pieces of the STL, in order to insure
that the parameters being used met the requirements of the that the parameters being used met the requirements of the

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 13. String Classes</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="strings.html" title="Part V.  Strings" /><link rel="prev" href="strings.html" title="Part V.  Strings" /><link rel="next" href="bk01pt05ch13s02.html" title="Case Sensitivity" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 13. String Classes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="strings.html">Prev</a> </td><th width="60%" align="center">Part V.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 13. String Classes</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="strings.html" title="Part V.  Strings" /><link rel="prev" href="strings.html" title="Part V.  Strings" /><link rel="next" href="bk01pt05ch13s02.html" title="Case Sensitivity" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 13. String Classes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="strings.html">Prev</a> </td><th width="60%" align="center">Part V. 
Strings Strings
</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt05ch13s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.strings.string"></a>Chapter 13. String Classes</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="bk01pt05ch13.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s02.html">Case Sensitivity</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s03.html">Arbitrary Character Types</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s04.html">Tokenizing</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s05.html">Shrink to Fit</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s06.html">CString (MFC)</a></span></dt></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="strings.string.simple"></a>Simple Transformations</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="bk01pt05ch13s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 13. String Classes"><div class="titlepage"><div><div><h2 class="title"><a id="manual.strings.string"></a>Chapter 13. String Classes</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="bk01pt05ch13.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s02.html">Case Sensitivity</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s03.html">Arbitrary Character Types</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s04.html">Tokenizing</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s05.html">Shrink to Fit</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s06.html">CString (MFC)</a></span></dt></dl></div><div class="sect1" title="Simple Transformations"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="strings.string.simple"></a>Simple Transformations</h2></div></div></div><p>
Here are Standard, simple, and portable ways to perform common Here are Standard, simple, and portable ways to perform common
transformations on a <code class="code">string</code> instance, such as transformations on a <code class="code">string</code> instance, such as
"convert to all upper case." The word transformations "convert to all upper case." The word transformations

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Case Sensitivity</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk01pt05ch13.html" title="Chapter 13. String Classes" /><link rel="prev" href="bk01pt05ch13.html" title="Chapter 13. String Classes" /><link rel="next" href="bk01pt05ch13s03.html" title="Arbitrary Character Types" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Case Sensitivity</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt05ch13.html">Prev</a> </td><th width="60%" align="center">Chapter 13. String Classes</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt05ch13s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="strings.string.case"></a>Case Sensitivity</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Case Sensitivity</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk01pt05ch13.html" title="Chapter 13. String Classes" /><link rel="prev" href="bk01pt05ch13.html" title="Chapter 13. String Classes" /><link rel="next" href="bk01pt05ch13s03.html" title="Arbitrary Character Types" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Case Sensitivity</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt05ch13.html">Prev</a> </td><th width="60%" align="center">Chapter 13. String Classes</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt05ch13s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Case Sensitivity"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="strings.string.case"></a>Case Sensitivity</h2></div></div></div><p>
</p><p>The well-known-and-if-it-isn't-well-known-it-ought-to-be </p><p>The well-known-and-if-it-isn't-well-known-it-ought-to-be
<a class="ulink" href="http://www.gotw.ca/gotw/" target="_top">Guru of the Week</a> <a class="ulink" href="http://www.gotw.ca/gotw/" target="_top">Guru of the Week</a>
discussions held on Usenet covered this topic in January of 1998. discussions held on Usenet covered this topic in January of 1998.
Briefly, the challenge was, “<span class="quote">write a 'ci_string' class which Briefly, the challenge was, <span class="quote"><span class="quote">write a 'ci_string' class which
is identical to the standard 'string' class, but is is identical to the standard 'string' class, but is
case-insensitive in the same way as the (common but nonstandard) case-insensitive in the same way as the (common but nonstandard)
C function stricmp()</span>”. C function stricmp()</span></span>.
</p><pre class="programlisting"> </p><pre class="programlisting">
ci_string s( "AbCdE" ); ci_string s( "AbCdE" );

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Arbitrary Character Types</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk01pt05ch13.html" title="Chapter 13. String Classes" /><link rel="prev" href="bk01pt05ch13s02.html" title="Case Sensitivity" /><link rel="next" href="bk01pt05ch13s04.html" title="Tokenizing" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Arbitrary Character Types</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt05ch13s02.html">Prev</a> </td><th width="60%" align="center">Chapter 13. String Classes</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt05ch13s04.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="strings.string.character_types"></a>Arbitrary Character Types</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Arbitrary Character Types</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk01pt05ch13.html" title="Chapter 13. String Classes" /><link rel="prev" href="bk01pt05ch13s02.html" title="Case Sensitivity" /><link rel="next" href="bk01pt05ch13s04.html" title="Tokenizing" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Arbitrary Character Types</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt05ch13s02.html">Prev</a> </td><th width="60%" align="center">Chapter 13. String Classes</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt05ch13s04.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Arbitrary Character Types"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="strings.string.character_types"></a>Arbitrary Character Types</h2></div></div></div><p>
</p><p>The <code class="code">std::basic_string</code> is tantalizingly general, in that </p><p>The <code class="code">std::basic_string</code> is tantalizingly general, in that
it is parameterized on the type of the characters which it holds. it is parameterized on the type of the characters which it holds.
In theory, you could whip up a Unicode character class and instantiate In theory, you could whip up a Unicode character class and instantiate

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Tokenizing</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk01pt05ch13.html" title="Chapter 13. String Classes" /><link rel="prev" href="bk01pt05ch13s03.html" title="Arbitrary Character Types" /><link rel="next" href="bk01pt05ch13s05.html" title="Shrink to Fit" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Tokenizing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt05ch13s03.html">Prev</a> </td><th width="60%" align="center">Chapter 13. String Classes</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt05ch13s05.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="strings.string.token"></a>Tokenizing</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Tokenizing</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk01pt05ch13.html" title="Chapter 13. String Classes" /><link rel="prev" href="bk01pt05ch13s03.html" title="Arbitrary Character Types" /><link rel="next" href="bk01pt05ch13s05.html" title="Shrink to Fit" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Tokenizing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt05ch13s03.html">Prev</a> </td><th width="60%" align="center">Chapter 13. String Classes</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt05ch13s05.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Tokenizing"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="strings.string.token"></a>Tokenizing</h2></div></div></div><p>
</p><p>The Standard C (and C++) function <code class="code">strtok()</code> leaves a lot to </p><p>The Standard C (and C++) function <code class="code">strtok()</code> leaves a lot to
be desired in terms of user-friendliness. It's unintuitive, it be desired in terms of user-friendliness. It's unintuitive, it
destroys the character string on which it operates, and it requires destroys the character string on which it operates, and it requires

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Shrink to Fit</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk01pt05ch13.html" title="Chapter 13. String Classes" /><link rel="prev" href="bk01pt05ch13s04.html" title="Tokenizing" /><link rel="next" href="bk01pt05ch13s06.html" title="CString (MFC)" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Shrink to Fit</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt05ch13s04.html">Prev</a> </td><th width="60%" align="center">Chapter 13. String Classes</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt05ch13s06.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="strings.string.shrink"></a>Shrink to Fit</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Shrink to Fit</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk01pt05ch13.html" title="Chapter 13. String Classes" /><link rel="prev" href="bk01pt05ch13s04.html" title="Tokenizing" /><link rel="next" href="bk01pt05ch13s06.html" title="CString (MFC)" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Shrink to Fit</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt05ch13s04.html">Prev</a> </td><th width="60%" align="center">Chapter 13. String Classes</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt05ch13s06.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Shrink to Fit"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="strings.string.shrink"></a>Shrink to Fit</h2></div></div></div><p>
</p><p>From GCC 3.4 calling <code class="code">s.reserve(res)</code> on a </p><p>From GCC 3.4 calling <code class="code">s.reserve(res)</code> on a
<code class="code">string s</code> with <code class="code">res &lt; s.capacity()</code> will <code class="code">string s</code> with <code class="code">res &lt; s.capacity()</code> will
reduce the string's capacity to <code class="code">std::max(s.size(), res)</code>. reduce the string's capacity to <code class="code">std::max(s.size(), res)</code>.
@ -10,7 +10,7 @@
std::string(str.data(), str.size()).swap(str); std::string(str.data(), str.size()).swap(str);
</pre><p>This is similar to the idiom for reducing </pre><p>This is similar to the idiom for reducing
a <code class="code">vector</code>'s memory usage a <code class="code">vector</code>'s memory usage
(see <a class="link" href="../faq.html#faq.size_equals_capacity" title="Question">this FAQ (see <a class="link" href="../faq.html#faq.size_equals_capacity" title="7.8.">this FAQ
entry</a>) but the regular copy constructor cannot be used entry</a>) but the regular copy constructor cannot be used
because libstdc++'s <code class="code">string</code> is Copy-On-Write. because libstdc++'s <code class="code">string</code> is Copy-On-Write.
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt05ch13s04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="bk01pt05ch13.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt05ch13s06.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Tokenizing </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> CString (MFC)</td></tr></table></div></body></html> </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt05ch13s04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="bk01pt05ch13.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt05ch13s06.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Tokenizing </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> CString (MFC)</td></tr></table></div></body></html>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>CString (MFC)</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk01pt05ch13.html" title="Chapter 13. String Classes" /><link rel="prev" href="bk01pt05ch13s05.html" title="Shrink to Fit" /><link rel="next" href="localization.html" title="Part VI.  Localization" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">CString (MFC)</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt05ch13s05.html">Prev</a> </td><th width="60%" align="center">Chapter 13. String Classes</th><td width="20%" align="right"> <a accesskey="n" href="localization.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="strings.string.Cstring"></a>CString (MFC)</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>CString (MFC)</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk01pt05ch13.html" title="Chapter 13. String Classes" /><link rel="prev" href="bk01pt05ch13s05.html" title="Shrink to Fit" /><link rel="next" href="localization.html" title="Part VI.  Localization" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">CString (MFC)</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt05ch13s05.html">Prev</a> </td><th width="60%" align="center">Chapter 13. String Classes</th><td width="20%" align="right"> <a accesskey="n" href="localization.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="CString (MFC)"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="strings.string.Cstring"></a>CString (MFC)</h2></div></div></div><p>
</p><p>A common lament seen in various newsgroups deals with the Standard </p><p>A common lament seen in various newsgroups deals with the Standard
string class as opposed to the Microsoft Foundation Class called string class as opposed to the Microsoft Foundation Class called
CString. Often programmers realize that a standard portable CString. Often programmers realize that a standard portable
@ -10,12 +10,12 @@
</p><p>Things are not as bad as they seem. In </p><p>Things are not as bad as they seem. In
<a class="ulink" href="http://gcc.gnu.org/ml/gcc/1999-04n/msg00236.html" target="_top">this <a class="ulink" href="http://gcc.gnu.org/ml/gcc/1999-04n/msg00236.html" target="_top">this
message</a>, Joe Buck points out a few very important things: message</a>, Joe Buck points out a few very important things:
</p><div class="itemizedlist"><ul type="disc"><li><p>The Standard <code class="code">string</code> supports all the operations </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The Standard <code class="code">string</code> supports all the operations
that CString does, with three exceptions. that CString does, with three exceptions.
</p></li><li><p>Two of those exceptions (whitespace trimming and case </p></li><li class="listitem"><p>Two of those exceptions (whitespace trimming and case
conversion) are trivial to implement. In fact, we do so conversion) are trivial to implement. In fact, we do so
on this page. on this page.
</p></li><li><p>The third is <code class="code">CString::Format</code>, which allows formatting </p></li><li class="listitem"><p>The third is <code class="code">CString::Format</code>, which allows formatting
in the style of <code class="code">sprintf</code>. This deserves some mention: in the style of <code class="code">sprintf</code>. This deserves some mention:
</p></li></ul></div><p> </p></li></ul></div><p>
The old libg++ library had a function called form(), which did much The old libg++ library had a function called form(), which did much
@ -68,18 +68,18 @@
performance is O(n). performance is O(n).
</pre><p>Joe Buck also pointed out some other things to keep in mind when </pre><p>Joe Buck also pointed out some other things to keep in mind when
comparing CString and the Standard string class: comparing CString and the Standard string class:
</p><div class="itemizedlist"><ul type="disc"><li><p>CString permits access to its internal representation; coders </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>CString permits access to its internal representation; coders
who exploited that may have problems moving to <code class="code">string</code>. who exploited that may have problems moving to <code class="code">string</code>.
</p></li><li><p>Microsoft ships the source to CString (in the files </p></li><li class="listitem"><p>Microsoft ships the source to CString (in the files
MFC\SRC\Str{core,ex}.cpp), so you could fix the allocation MFC\SRC\Str{core,ex}.cpp), so you could fix the allocation
bug and rebuild your MFC libraries. bug and rebuild your MFC libraries.
<span class="emphasis"><em><span class="emphasis"><em>Note:</em></span> It looks like the CString shipped <span class="emphasis"><em><span class="emphasis"><em>Note:</em></span> It looks like the CString shipped
with VC++6.0 has fixed this, although it may in fact have been with VC++6.0 has fixed this, although it may in fact have been
one of the VC++ SPs that did it.</em></span> one of the VC++ SPs that did it.</em></span>
</p></li><li><p><code class="code">string</code> operations like this have O(n) complexity </p></li><li class="listitem"><p><code class="code">string</code> operations like this have O(n) complexity
<span class="emphasis"><em>if the implementors do it correctly</em></span>. The libstdc++ <span class="emphasis"><em>if the implementors do it correctly</em></span>. The libstdc++
implementors did it correctly. Other vendors might not. implementors did it correctly. Other vendors might not.
</p></li><li><p>While parts of the SGI STL are used in libstdc++, their </p></li><li class="listitem"><p>While parts of the SGI STL are used in libstdc++, their
string class is not. The SGI <code class="code">string</code> is essentially string class is not. The SGI <code class="code">string</code> is essentially
<code class="code">vector&lt;char&gt;</code> and does not do any reference <code class="code">vector&lt;char&gt;</code> and does not do any reference
counting like libstdc++'s does. (It is O(n), though.) counting like libstdc++'s does. (It is O(n), though.)

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 19. Predefined</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="iterators.html" title="Part VIII.  Iterators" /><link rel="prev" href="iterators.html" title="Part VIII.  Iterators" /><link rel="next" href="bk01pt08ch19s02.html" title="One Past the End" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 19. Predefined</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="iterators.html">Prev</a> </td><th width="60%" align="center">Part VIII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 19. Predefined</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="iterators.html" title="Part VIII.  Iterators" /><link rel="prev" href="iterators.html" title="Part VIII.  Iterators" /><link rel="next" href="bk01pt08ch19s02.html" title="One Past the End" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 19. Predefined</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="iterators.html">Prev</a> </td><th width="60%" align="center">Part VIII. 
Iterators Iterators
</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt08ch19s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.iterators.predefined"></a>Chapter 19. Predefined</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="bk01pt08ch19.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="sect1"><a href="bk01pt08ch19s02.html">One Past the End</a></span></dt></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="iterators.predefined.vs_pointers"></a>Iterators vs. Pointers</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="bk01pt08ch19s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 19. Predefined"><div class="titlepage"><div><div><h2 class="title"><a id="manual.iterators.predefined"></a>Chapter 19. Predefined</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="bk01pt08ch19.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="sect1"><a href="bk01pt08ch19s02.html">One Past the End</a></span></dt></dl></div><div class="sect1" title="Iterators vs. Pointers"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="iterators.predefined.vs_pointers"></a>Iterators vs. Pointers</h2></div></div></div><p>
The following The following
FAQ <a class="link" href="../faq.html#faq.iterator_as_pod" title="Question">entry</a> points out that FAQ <a class="link" href="../faq.html#faq.iterator_as_pod" title="7.1.">entry</a> points out that
iterators are not implemented as pointers. They are a generalization iterators are not implemented as pointers. They are a generalization
of pointers, but they are implemented in libstdc++ as separate of pointers, but they are implemented in libstdc++ as separate
classes. classes.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>One Past the End</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk01pt08ch19.html" title="Chapter 19. Predefined" /><link rel="prev" href="bk01pt08ch19.html" title="Chapter 19. Predefined" /><link rel="next" href="algorithms.html" title="Part IX.  Algorithms" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">One Past the End</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt08ch19.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Predefined</th><td width="20%" align="right"> <a accesskey="n" href="algorithms.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="iterators.predefined.end"></a>One Past the End</h2></div></div></div><p>This starts off sounding complicated, but is actually very easy, <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>One Past the End</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk01pt08ch19.html" title="Chapter 19. Predefined" /><link rel="prev" href="bk01pt08ch19.html" title="Chapter 19. Predefined" /><link rel="next" href="algorithms.html" title="Part IX.  Algorithms" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">One Past the End</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt08ch19.html">Prev</a> </td><th width="60%" align="center">Chapter 19. Predefined</th><td width="20%" align="right"> <a accesskey="n" href="algorithms.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="One Past the End"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="iterators.predefined.end"></a>One Past the End</h2></div></div></div><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>Beginners usually have a little trouble understand the whole </p><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
@ -9,15 +9,15 @@
</p><p>First, some history, and a reminder of some of the funkier rules in </p><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><div class="orderedlist"><ol type="1"><li><p>You can point anywhere in the array, <span class="emphasis"><em>or to the first element </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>You can point anywhere in the array, <span class="emphasis"><em>or to the first element
past the end of the array</em></span>. A pointer that points to one past the end of the array</em></span>. 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.
</p></li><li><p>You can only dereference a pointer that points into an array. </p></li><li class="listitem"><p>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.
</p></li><li><p>Strictly speaking, simply pointing anywhere else invokes </p></li><li class="listitem"><p>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.

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 20. Mutating</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; , &#10; algorithm&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="algorithms.html" title="Part IX.  Algorithms" /><link rel="prev" href="bk01pt09pr02.html" title="" /><link rel="next" href="numerics.html" title="Part X.  Numerics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 20. Mutating</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt09pr02.html">Prev</a> </td><th width="60%" align="center">Part IX.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 20. Mutating</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; , &#10; algorithm&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="algorithms.html" title="Part IX.  Algorithms" /><link rel="prev" href="bk01pt09pr02.html" title="" /><link rel="next" href="numerics.html" title="Part X.  Numerics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 20. Mutating</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt09pr02.html">Prev</a> </td><th width="60%" align="center">Part IX. 
Algorithms Algorithms
</th><td width="20%" align="right"> <a accesskey="n" href="numerics.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.algorithms.mutating"></a>Chapter 20. Mutating</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="bk01pt09ch20.html#algorithms.mutating.swap">swap</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt09ch20.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="algorithms.mutating.swap"></a><code class="function">swap</code></h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="algorithms.swap.specializations"></a>Specializations</h3></div></div></div><p>If you call <code class="code"> std::swap(x,y); </code> where x and y are standard </th><td width="20%" align="right"> <a accesskey="n" href="numerics.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 20. Mutating"><div class="titlepage"><div><div><h2 class="title"><a id="manual.algorithms.mutating"></a>Chapter 20. Mutating</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="bk01pt09ch20.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt09ch20.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></div><div class="sect1" title="swap"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="algorithms.mutating.swap"></a><code class="function">swap</code></h2></div></div></div><div class="sect2" title="Specializations"><div class="titlepage"><div><div><h3 class="title"><a id="algorithms.swap.specializations"></a>Specializations</h3></div></div></div><p>If you call <code class="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
<code class="code"> x.swap(y); </code> instead. <code class="code"> x.swap(y); </code> instead.
</p><p>This allows member functions of each container class to take over, and </p><p>This allows member functions of each container class to take over, and

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; , &#10; algorithm&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="algorithms.html" title="Part IX.  Algorithms" /><link rel="prev" href="algorithms.html" title="Part IX.  Algorithms" /><link rel="next" href="bk01pt09ch20.html" title="Chapter 20. Mutating" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="algorithms.html">Prev</a> </td><th width="60%" align="center">Part IX.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; , &#10; algorithm&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="algorithms.html" title="Part IX.  Algorithms" /><link rel="prev" href="algorithms.html" title="Part IX.  Algorithms" /><link rel="next" href="bk01pt09ch20.html" title="Chapter 20. Mutating" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="algorithms.html">Prev</a> </td><th width="60%" align="center">Part IX. 
Algorithms Algorithms
</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt09ch20.html">Next</a></td></tr></table><hr /></div><div class="preface" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id617760"></a></h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="bk01pt09ch20.html">Next</a></td></tr></table><hr /></div><div class="preface"><div class="titlepage"><div><div><h2 class="title"><a id="id455881"></a></h2></div></div></div><p>
The neatest accomplishment of the algorithms chapter is that all the 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><div class="orderedlist"><ol type="1"><li><p> </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
Anything that behaves like an iterator can be used in one of 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.
</p></li><li><p> </p></li><li class="listitem"><p>
The algorithms do not (and cannot) affect the container as a 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

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>C99</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="numerics_and_c.html" title="Chapter 23. Interacting with C" /><link rel="prev" href="numerics_and_c.html" title="Chapter 23. Interacting with C" /><link rel="next" href="io.html" title="Part XI.  Input and Output" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">C99</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="numerics_and_c.html">Prev</a> </td><th width="60%" align="center">Chapter 23. Interacting with C</th><td width="20%" align="right"> <a accesskey="n" href="io.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="numerics.c.c99"></a>C99</h2></div></div></div><p>In addition to the other topics on this page, we'll note here some <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>C99</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="numerics_and_c.html" title="Chapter 23. Interacting with C" /><link rel="prev" href="numerics_and_c.html" title="Chapter 23. Interacting with C" /><link rel="next" href="io.html" title="Part XI.  Input and Output" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">C99</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="numerics_and_c.html">Prev</a> </td><th width="60%" align="center">Chapter 23. Interacting with C</th><td width="20%" align="right"> <a accesskey="n" href="io.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="C99"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="numerics.c.c99"></a>C99</h2></div></div></div><p>In addition to the other topics on this page, we'll note here some
of the C99 features that appear in libstdc++. of the C99 features that appear in libstdc++.
</p><p>The C99 features depend on the <code class="code">--enable-c99</code> configure flag. </p><p>The C99 features depend on the <code class="code">--enable-c99</code> configure flag.
This flag is already on by default, but it can be disabled by the This flag is already on by default, but it can be disabled by the

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Buffering</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="streambufs.html" title="Chapter 25. Stream Buffers" /><link rel="prev" href="streambufs.html" title="Chapter 25. Stream Buffers" /><link rel="next" href="stringstreams.html" title="Chapter 26. Memory Based Streams" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Buffering</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="streambufs.html">Prev</a> </td><th width="60%" align="center">Chapter 25. Stream Buffers</th><td width="20%" align="right"> <a accesskey="n" href="stringstreams.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="io.streambuf.buffering"></a>Buffering</h2></div></div></div><p>First, are you sure that you understand buffering? Particularly <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Buffering</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="streambufs.html" title="Chapter 25. Stream Buffers" /><link rel="prev" href="streambufs.html" title="Chapter 25. Stream Buffers" /><link rel="next" href="stringstreams.html" title="Chapter 26. Memory Based Streams" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Buffering</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="streambufs.html">Prev</a> </td><th width="60%" align="center">Chapter 25. Stream Buffers</th><td width="20%" align="right"> <a accesskey="n" href="stringstreams.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Buffering"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="io.streambuf.buffering"></a>Buffering</h2></div></div></div><p>First, are you sure that you understand buffering? Particularly
the fact that C++ may not, in fact, have anything to do with it? the fact that C++ may not, in fact, have anything to do with it?
</p><p>The rules for buffering can be a little odd, but they aren't any </p><p>The rules for buffering can be a little odd, but they aren't any
different from those of C. (Maybe that's why they can be a bit different from those of C. (Maybe that's why they can be a bit

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Binary Input and Output</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="fstreams.html" title="Chapter 27. File Based Streams" /><link rel="prev" href="fstreams.html" title="Chapter 27. File Based Streams" /><link rel="next" href="io_and_c.html" title="Chapter 28. Interacting with C" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Binary Input and Output</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="fstreams.html">Prev</a> </td><th width="60%" align="center">Chapter 27. File Based Streams</th><td width="20%" align="right"> <a accesskey="n" href="io_and_c.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.io.filestreams.binary"></a>Binary Input and Output</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Binary Input and Output</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="fstreams.html" title="Chapter 27. File Based Streams" /><link rel="prev" href="fstreams.html" title="Chapter 27. File Based Streams" /><link rel="next" href="io_and_c.html" title="Chapter 28. Interacting with C" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Binary Input and Output</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="fstreams.html">Prev</a> </td><th width="60%" align="center">Chapter 27. File Based Streams</th><td width="20%" align="right"> <a accesskey="n" href="io_and_c.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Binary Input and Output"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.io.filestreams.binary"></a>Binary Input and Output</h2></div></div></div><p>
</p><p>The first and most important thing to remember about binary I/O is </p><p>The first and most important thing to remember about binary I/O is
that opening a file with <code class="code">ios::binary</code> is not, repeat that opening a file with <code class="code">ios::binary</code> is not, repeat
<span class="emphasis"><em>not</em></span>, the only thing you have to do. It is not a silver <span class="emphasis"><em>not</em></span>, the only thing you have to do. It is not a silver
@ -38,26 +38,26 @@
of <span class="emphasis"><em>formatting</em></span> functions and classes to perform something of <span class="emphasis"><em>formatting</em></span> functions and classes to perform something
which <span class="emphasis"><em>requires</em></span> that formatting not be done? There are a which <span class="emphasis"><em>requires</em></span> that formatting not be done? There are a
seemingly infinite number of solutions, and a few are listed here: seemingly infinite number of solutions, and a few are listed here:
</p><div class="itemizedlist"><ul type="disc"><li><p><span class="quote">Derive your own fstream-type classes and write your own </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="quote"><span class="quote">Derive your own fstream-type classes and write your own
&lt;&lt;/&gt;&gt; operators to do binary I/O on whatever data &lt;&lt;/&gt;&gt; operators to do binary I/O on whatever data
types you're using.</span> types you're using.</span></span>
</p><p> </p><p>
This is a Bad Thing, because while This is a Bad Thing, because while
the compiler would probably be just fine with it, other humans the compiler would probably be just fine with it, other humans
are going to be confused. The overloaded bitshift operators are going to be confused. The overloaded bitshift operators
have a well-defined meaning (formatting), and this breaks it. have a well-defined meaning (formatting), and this breaks it.
</p></li><li><p> </p></li><li class="listitem"><p>
<span class="quote">Build the file structure in memory, then <span class="quote"><span class="quote">Build the file structure in memory, then
<code class="code">mmap()</code> the file and copy the <code class="code">mmap()</code> the file and copy the
structure. structure.
</span> </span></span>
</p><p> </p><p>
Well, this is easy to make work, and easy to break, and is Well, this is easy to make work, and easy to break, and is
pretty equivalent to using <code class="code">::read()</code> and pretty equivalent to using <code class="code">::read()</code> and
<code class="code">::write()</code> directly, and makes no use of the <code class="code">::write()</code> directly, and makes no use of the
iostream library at all... iostream library at all...
</p></li><li><p> </p></li><li class="listitem"><p>
<span class="quote">Use streambufs, that's what they're there for.</span> <span class="quote"><span class="quote">Use streambufs, that's what they're there for.</span></span>
</p><p> </p><p>
While not trivial for the beginner, this is the best of all While not trivial for the beginner, this is the best of all
solutions. The streambuf/filebuf layer is the layer that is solutions. The streambuf/filebuf layer is the layer that is

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Performance</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="io_and_c.html" title="Chapter 28. Interacting with C" /><link rel="prev" href="io_and_c.html" title="Chapter 28. Interacting with C" /><link rel="next" href="extensions.html" title="Part XII.  Extensions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Performance</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="io_and_c.html">Prev</a> </td><th width="60%" align="center">Chapter 28. Interacting with C</th><td width="20%" align="right"> <a accesskey="n" href="extensions.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.io.c.sync"></a>Performance</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Performance</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="io_and_c.html" title="Chapter 28. Interacting with C" /><link rel="prev" href="io_and_c.html" title="Chapter 28. Interacting with C" /><link rel="next" href="extensions.html" title="Part XII.  Extensions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Performance</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="io_and_c.html">Prev</a> </td><th width="60%" align="center">Chapter 28. Interacting with C</th><td width="20%" align="right"> <a accesskey="n" href="extensions.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Performance"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.io.c.sync"></a>Performance</h2></div></div></div><p>
Pathetic Performance? Ditch C. Pathetic Performance? Ditch C.
</p><p>It sounds like a flame on C, but it isn't. Really. Calm down. </p><p>It sounds like a flame on C, but it isn't. Really. Calm down.
I'm just saying it to get your attention. I'm just saying it to get your attention.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Semantics</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; debug&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="debug_mode.html" title="Chapter 30. Debug Mode" /><link rel="prev" href="debug_mode.html" title="Chapter 30. Debug Mode" /><link rel="next" href="bk01pt12ch30s03.html" title="Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Semantics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="debug_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Debug Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch30s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.debug_mode.semantics"></a>Semantics</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Semantics</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; debug&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="debug_mode.html" title="Chapter 30. Debug Mode" /><link rel="prev" href="debug_mode.html" title="Chapter 30. Debug Mode" /><link rel="next" href="bk01pt12ch30s03.html" title="Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Semantics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="debug_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Debug Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch30s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Semantics"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.debug_mode.semantics"></a>Semantics</h2></div></div></div><p>
</p><p>A program that uses the C++ standard library correctly </p><p>A program that uses the C++ standard library correctly
will maintain the same semantics under debug mode as it had with will maintain the same semantics under debug mode as it had with
the normal (release) library. All functional and exception-handling the normal (release) library. All functional and exception-handling
@ -36,7 +36,7 @@
(N.B. In GCC 3.4.x and 4.0.0, due to a bug, (N.B. In GCC 3.4.x and 4.0.0, due to a bug,
<code class="code">-D_GLIBXX_DEBUG_PEDANTIC</code> was also needed. The problem has <code class="code">-D_GLIBXX_DEBUG_PEDANTIC</code> was also needed. The problem has
been fixed in GCC 4.0.1 and later versions.) </p><p>The following library components provide extra debugging been fixed in GCC 4.0.1 and later versions.) </p><p>The following library components provide extra debugging
capabilities in debug mode:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="code">std::basic_string</code> (no safe iterators and see note below)</p></li><li><p><code class="code">std::bitset</code></p></li><li><p><code class="code">std::deque</code></p></li><li><p><code class="code">std::list</code></p></li><li><p><code class="code">std::map</code></p></li><li><p><code class="code">std::multimap</code></p></li><li><p><code class="code">std::multiset</code></p></li><li><p><code class="code">std::set</code></p></li><li><p><code class="code">std::vector</code></p></li><li><p><code class="code">std::unordered_map</code></p></li><li><p><code class="code">std::unordered_multimap</code></p></li><li><p><code class="code">std::unordered_set</code></p></li><li><p><code class="code">std::unordered_multiset</code></p></li></ul></div><p>N.B. although there are precondition checks for some string operations, capabilities in debug mode:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><code class="code">std::basic_string</code> (no safe iterators and see note below)</p></li><li class="listitem"><p><code class="code">std::bitset</code></p></li><li class="listitem"><p><code class="code">std::deque</code></p></li><li class="listitem"><p><code class="code">std::list</code></p></li><li class="listitem"><p><code class="code">std::map</code></p></li><li class="listitem"><p><code class="code">std::multimap</code></p></li><li class="listitem"><p><code class="code">std::multiset</code></p></li><li class="listitem"><p><code class="code">std::set</code></p></li><li class="listitem"><p><code class="code">std::vector</code></p></li><li class="listitem"><p><code class="code">std::unordered_map</code></p></li><li class="listitem"><p><code class="code">std::unordered_multimap</code></p></li><li class="listitem"><p><code class="code">std::unordered_set</code></p></li><li class="listitem"><p><code class="code">std::unordered_multiset</code></p></li></ul></div><p>N.B. although there are precondition checks for some string operations,
e.g. <code class="code">operator[]</code>, e.g. <code class="code">operator[]</code>,
they will not always be run when using the <code class="code">char</code> and they will not always be run when using the <code class="code">char</code> and
<code class="code">wchar_t</code> specialisations (<code class="code">std::string</code> and <code class="code">wchar_t</code> specialisations (<code class="code">std::string</code> and

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Using</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; debug&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="debug_mode.html" title="Chapter 30. Debug Mode" /><link rel="prev" href="bk01pt12ch30s02.html" title="Semantics" /><link rel="next" href="bk01pt12ch30s04.html" title="Design" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch30s02.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Debug Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch30s04.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.debug_mode.using"></a>Using</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Using</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; debug&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="debug_mode.html" title="Chapter 30. Debug Mode" /><link rel="prev" href="bk01pt12ch30s02.html" title="Semantics" /><link rel="next" href="bk01pt12ch30s04.html" title="Design" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Using</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch30s02.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Debug Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch30s04.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Using"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.debug_mode.using"></a>Using</h2></div></div></div><p>
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug_mode.using.mode"></a>Using the Debug Mode</h3></div></div></div><p>To use the libstdc++ debug mode, compile your application with the </p><div class="sect2" title="Using the Debug Mode"><div class="titlepage"><div><div><h3 class="title"><a id="debug_mode.using.mode"></a>Using the Debug Mode</h3></div></div></div><p>To use the libstdc++ debug mode, compile your application with the
compiler flag <code class="code">-D_GLIBCXX_DEBUG</code>. Note that this flag compiler flag <code class="code">-D_GLIBCXX_DEBUG</code>. Note that this flag
changes the sizes and behavior of standard class templates such changes the sizes and behavior of standard class templates such
as <code class="code">std::vector</code>, and therefore you can only link code as <code class="code">std::vector</code>, and therefore you can only link code
@ -10,7 +10,7 @@
units.</p><p>By default, error messages are formatted to fit on lines of about units.</p><p>By default, error messages are formatted to fit on lines of about
78 characters. The environment variable 78 characters. The environment variable
<code class="code">GLIBCXX_DEBUG_MESSAGE_LENGTH</code> can be used to request a <code class="code">GLIBCXX_DEBUG_MESSAGE_LENGTH</code> can be used to request a
different length.</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug_mode.using.specific"></a>Using a Specific Debug Container</h3></div></div></div><p>When it is not feasible to recompile your entire application, or different length.</p></div><div class="sect2" title="Using a Specific Debug Container"><div class="titlepage"><div><div><h3 class="title"><a id="debug_mode.using.specific"></a>Using a Specific Debug Container</h3></div></div></div><p>When it is not feasible to recompile your entire application, or
only specific containers need checking, debugging containers are only specific containers need checking, debugging containers are
available as GNU extensions. These debugging containers are available as GNU extensions. These debugging containers are
functionally equivalent to the standard drop-in containers used in functionally equivalent to the standard drop-in containers used in
@ -19,6 +19,6 @@
mode or with debug mode. The mode or with debug mode. The
following table provides the names and headers of the debugging following table provides the names and headers of the debugging
containers: containers:
</p><div class="table"><a id="id672482"></a><p class="title"><b>Table 30.1. Debugging Containers</b></p><div class="table-contents"><table summary="Debugging Containers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Container</th><th align="left">Header</th><th align="left">Debug container</th><th align="left">Debug header</th></tr></thead><tbody><tr><td align="left"><code class="classname">std::bitset</code></td><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="classname">__gnu_debug::bitset</code></td><td align="left"><code class="filename">bitset</code></td></tr><tr><td align="left"><code class="classname">std::deque</code></td><td align="left"><code class="filename">deque</code></td><td align="left"><code class="classname">__gnu_debug::deque</code></td><td align="left"><code class="filename">deque</code></td></tr><tr><td align="left"><code class="classname">std::list</code></td><td align="left"><code class="filename">list</code></td><td align="left"><code class="classname">__gnu_debug::list</code></td><td align="left"><code class="filename">list</code></td></tr><tr><td align="left"><code class="classname">std::map</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="classname">__gnu_debug::map</code></td><td align="left"><code class="filename">map</code></td></tr><tr><td align="left"><code class="classname">std::multimap</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="classname">__gnu_debug::multimap</code></td><td align="left"><code class="filename">map</code></td></tr><tr><td align="left"><code class="classname">std::multiset</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="classname">__gnu_debug::multiset</code></td><td align="left"><code class="filename">set</code></td></tr><tr><td align="left"><code class="classname">std::set</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="classname">__gnu_debug::set</code></td><td align="left"><code class="filename">set</code></td></tr><tr><td align="left"><code class="classname">std::string</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::string</code></td><td align="left"><code class="filename">string</code></td></tr><tr><td align="left"><code class="classname">std::wstring</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::wstring</code></td><td align="left"><code class="filename">string</code></td></tr><tr><td align="left"><code class="classname">std::basic_string</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::basic_string</code></td><td align="left"><code class="filename">string</code></td></tr><tr><td align="left"><code class="classname">std::vector</code></td><td align="left"><code class="filename">vector</code></td><td align="left"><code class="classname">__gnu_debug::vector</code></td><td align="left"><code class="filename">vector</code></td></tr></tbody></table></div></div><br class="table-break" /><p>In addition, when compiling in C++0x mode, these additional </p><div class="table"><a id="id536896"></a><p class="title"><b>Table 30.1. Debugging Containers</b></p><div class="table-contents"><table summary="Debugging Containers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Container</th><th align="left">Header</th><th align="left">Debug container</th><th align="left">Debug header</th></tr></thead><tbody><tr><td align="left"><code class="classname">std::bitset</code></td><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="classname">__gnu_debug::bitset</code></td><td align="left"><code class="filename">bitset</code></td></tr><tr><td align="left"><code class="classname">std::deque</code></td><td align="left"><code class="filename">deque</code></td><td align="left"><code class="classname">__gnu_debug::deque</code></td><td align="left"><code class="filename">deque</code></td></tr><tr><td align="left"><code class="classname">std::list</code></td><td align="left"><code class="filename">list</code></td><td align="left"><code class="classname">__gnu_debug::list</code></td><td align="left"><code class="filename">list</code></td></tr><tr><td align="left"><code class="classname">std::map</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="classname">__gnu_debug::map</code></td><td align="left"><code class="filename">map</code></td></tr><tr><td align="left"><code class="classname">std::multimap</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="classname">__gnu_debug::multimap</code></td><td align="left"><code class="filename">map</code></td></tr><tr><td align="left"><code class="classname">std::multiset</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="classname">__gnu_debug::multiset</code></td><td align="left"><code class="filename">set</code></td></tr><tr><td align="left"><code class="classname">std::set</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="classname">__gnu_debug::set</code></td><td align="left"><code class="filename">set</code></td></tr><tr><td align="left"><code class="classname">std::string</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::string</code></td><td align="left"><code class="filename">string</code></td></tr><tr><td align="left"><code class="classname">std::wstring</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::wstring</code></td><td align="left"><code class="filename">string</code></td></tr><tr><td align="left"><code class="classname">std::basic_string</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::basic_string</code></td><td align="left"><code class="filename">string</code></td></tr><tr><td align="left"><code class="classname">std::vector</code></td><td align="left"><code class="filename">vector</code></td><td align="left"><code class="classname">__gnu_debug::vector</code></td><td align="left"><code class="filename">vector</code></td></tr></tbody></table></div></div><br class="table-break" /><p>In addition, when compiling in C++0x mode, these additional
containers have additional debug capability. containers have additional debug capability.
</p><div class="table"><a id="id646525"></a><p class="title"><b>Table 30.2. Debugging Containers C++0x</b></p><div class="table-contents"><table summary="Debugging Containers C++0x" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Container</th><th align="left">Header</th><th align="left">Debug container</th><th align="left">Debug header</th></tr></thead><tbody><tr><td align="left"><code class="classname">std::unordered_map</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="classname">__gnu_debug::unordered_map</code></td><td align="left"><code class="filename">unordered_map</code></td></tr><tr><td align="left"><code class="classname">std::unordered_multimap</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="classname">__gnu_debug::unordered_multimap</code></td><td align="left"><code class="filename">unordered_map</code></td></tr><tr><td align="left"><code class="classname">std::unordered_set</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="classname">__gnu_debug::unordered_set</code></td><td align="left"><code class="filename">unordered_set</code></td></tr><tr><td align="left"><code class="classname">std::unordered_multiset</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="classname">__gnu_debug::unordered_multiset</code></td><td align="left"><code class="filename">unordered_set</code></td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch30s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="debug_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch30s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html> </p><div class="table"><a id="id509362"></a><p class="title"><b>Table 30.2. Debugging Containers C++0x</b></p><div class="table-contents"><table summary="Debugging Containers C++0x" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Container</th><th align="left">Header</th><th align="left">Debug container</th><th align="left">Debug header</th></tr></thead><tbody><tr><td align="left"><code class="classname">std::unordered_map</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="classname">__gnu_debug::unordered_map</code></td><td align="left"><code class="filename">unordered_map</code></td></tr><tr><td align="left"><code class="classname">std::unordered_multimap</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="classname">__gnu_debug::unordered_multimap</code></td><td align="left"><code class="filename">unordered_map</code></td></tr><tr><td align="left"><code class="classname">std::unordered_set</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="classname">__gnu_debug::unordered_set</code></td><td align="left"><code class="filename">unordered_set</code></td></tr><tr><td align="left"><code class="classname">std::unordered_multiset</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="classname">__gnu_debug::unordered_multiset</code></td><td align="left"><code class="filename">unordered_set</code></td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch30s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="debug_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch30s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Design</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; debug&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="debug_mode.html" title="Chapter 30. Debug Mode" /><link rel="prev" href="bk01pt12ch30s03.html" title="Using" /><link rel="next" href="parallel_mode.html" title="Chapter 31. Parallel Mode" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch30s03.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Debug Mode</th><td width="20%" align="right"> <a accesskey="n" href="parallel_mode.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.debug_mode.design"></a>Design</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Design</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; debug&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="debug_mode.html" title="Chapter 30. Debug Mode" /><link rel="prev" href="bk01pt12ch30s03.html" title="Using" /><link rel="next" href="parallel_mode.html" title="Chapter 31. Parallel Mode" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch30s03.html">Prev</a> </td><th width="60%" align="center">Chapter 30. Debug Mode</th><td width="20%" align="right"> <a accesskey="n" href="parallel_mode.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Design"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.debug_mode.design"></a>Design</h2></div></div></div><p>
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug_mode.design.goals"></a>Goals</h3></div></div></div><p> </p><div class="sect2" title="Goals"><div class="titlepage"><div><div><h3 class="title"><a id="debug_mode.design.goals"></a>Goals</h3></div></div></div><p>
</p><p> The libstdc++ debug mode replaces unsafe (but efficient) standard </p><p> The libstdc++ debug mode replaces unsafe (but efficient) standard
containers and iterators with semantically equivalent safe standard containers and iterators with semantically equivalent safe standard
containers and iterators to aid in debugging user programs. The containers and iterators to aid in debugging user programs. The
following goals directed the design of the libstdc++ debug mode:</p><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Correctness</em></span>: the libstdc++ debug mode must not change following goals directed the design of the libstdc++ debug mode:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Correctness</em></span>: the libstdc++ debug mode must not change
the semantics of the standard library for all cases specified in the semantics of the standard library for all cases specified in
the ANSI/ISO C++ standard. The essence of this constraint is that the ANSI/ISO C++ standard. The essence of this constraint is that
any valid C++ program should behave in the same manner regardless any valid C++ program should behave in the same manner regardless
@ -16,18 +16,18 @@
valid. A program that is not valid C++ (e.g., invokes undefined valid. A program that is not valid C++ (e.g., invokes undefined
behavior) is not required to behave similarly, although the debug behavior) is not required to behave similarly, although the debug
mode will abort with a diagnostic when it detects undefined mode will abort with a diagnostic when it detects undefined
behavior.</p></li><li><p><span class="emphasis"><em>Performance</em></span>: the additional of the libstdc++ debug mode behavior.</p></li><li class="listitem"><p><span class="emphasis"><em>Performance</em></span>: the additional of the libstdc++ debug mode
must not affect the performance of the library when it is compiled must not affect the performance of the library when it is compiled
in release mode. Performance of the libstdc++ debug mode is in release mode. Performance of the libstdc++ debug mode is
secondary (and, in fact, will be worse than the release secondary (and, in fact, will be worse than the release
mode).</p></li><li><p><span class="emphasis"><em>Usability</em></span>: the libstdc++ debug mode should be easy to mode).</p></li><li class="listitem"><p><span class="emphasis"><em>Usability</em></span>: the libstdc++ debug mode should be easy to
use. It should be easily incorporated into the user's development use. It should be easily incorporated into the user's development
environment (e.g., by requiring only a single new compiler switch) environment (e.g., by requiring only a single new compiler switch)
and should produce reasonable diagnostics when it detects a and should produce reasonable diagnostics when it detects a
problem with the user program. Usability also involves detection problem with the user program. Usability also involves detection
of errors when using the debug mode incorrectly, e.g., by linking of errors when using the debug mode incorrectly, e.g., by linking
a release-compiled object against a debug-compiled object if in a release-compiled object against a debug-compiled object if in
fact the resulting program will not run correctly.</p></li><li><p><span class="emphasis"><em>Minimize recompilation</em></span>: While it is expected that fact the resulting program will not run correctly.</p></li><li class="listitem"><p><span class="emphasis"><em>Minimize recompilation</em></span>: While it is expected that
users recompile at least part of their program to use debug users recompile at least part of their program to use debug
mode, the amount of recompilation affects the mode, the amount of recompilation affects the
detect-compile-debug turnaround time. This indirectly affects the detect-compile-debug turnaround time. This indirectly affects the
@ -39,24 +39,24 @@
higher-numbered conformance levels are more usable (i.e., require higher-numbered conformance levels are more usable (i.e., require
less recompilation) but are more complicated to implement than less recompilation) but are more complicated to implement than
the lower-numbered conformance levels. the lower-numbered conformance levels.
</p><div class="orderedlist"><ol type="1"><li><p><span class="emphasis"><em>Full recompilation</em></span>: The user must recompile his or </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p><span class="emphasis"><em>Full recompilation</em></span>: The user must recompile his or
her entire application and all C++ libraries it depends on, her entire application and all C++ libraries it depends on,
including the C++ standard library that ships with the including the C++ standard library that ships with the
compiler. This must be done even if only a small part of the compiler. This must be done even if only a small part of the
program can use debugging features.</p></li><li><p><span class="emphasis"><em>Full user recompilation</em></span>: The user must recompile program can use debugging features.</p></li><li class="listitem"><p><span class="emphasis"><em>Full user recompilation</em></span>: The user must recompile
his or her entire application and all C++ libraries it depends his or her entire application and all C++ libraries it depends
on, but not the C++ standard library itself. This must be done on, but not the C++ standard library itself. This must be done
even if only a small part of the program can use debugging even if only a small part of the program can use debugging
features. This can be achieved given a full recompilation features. This can be achieved given a full recompilation
system by compiling two versions of the standard library when system by compiling two versions of the standard library when
the compiler is installed and linking against the appropriate the compiler is installed and linking against the appropriate
one, e.g., a multilibs approach.</p></li><li><p><span class="emphasis"><em>Partial recompilation</em></span>: The user must recompile the one, e.g., a multilibs approach.</p></li><li class="listitem"><p><span class="emphasis"><em>Partial recompilation</em></span>: The user must recompile the
parts of his or her application and the C++ libraries it parts of his or her application and the C++ libraries it
depends on that will use the debugging facilities depends on that will use the debugging facilities
directly. This means that any code that uses the debuggable directly. This means that any code that uses the debuggable
standard containers would need to be recompiled, but code standard containers would need to be recompiled, but code
that does not use them (but may, for instance, use IOStreams) that does not use them (but may, for instance, use IOStreams)
would not have to be recompiled.</p></li><li><p><span class="emphasis"><em>Per-use recompilation</em></span>: The user must recompile the would not have to be recompiled.</p></li><li class="listitem"><p><span class="emphasis"><em>Per-use recompilation</em></span>: The user must recompile the
parts of his or her application and the C++ libraries it parts of his or her application and the C++ libraries it
depends on where debugging should occur, and any other code depends on where debugging should occur, and any other code
that interacts with those containers. This means that a set of that interacts with those containers. This means that a set of
@ -74,7 +74,7 @@
behavior is technically a violation of the One Definition behavior is technically a violation of the One Definition
Rule, this ability tends to be very important in Rule, this ability tends to be very important in
practice. The libstdc++ debug mode supports this level of practice. The libstdc++ debug mode supports this level of
recompilation. </p></li><li><p><span class="emphasis"><em>Per-unit recompilation</em></span>: The user must only recompilation. </p></li><li class="listitem"><p><span class="emphasis"><em>Per-unit recompilation</em></span>: The user must only
recompile the translation units where checking should occur, recompile the translation units where checking should occur,
regardless of where debuggable standard containers are regardless of where debuggable standard containers are
used. This has also been dubbed "<code class="code">-g</code> mode", used. This has also been dubbed "<code class="code">-g</code> mode",
@ -89,10 +89,10 @@
(performance regression) or allocating extra memory associated (performance regression) or allocating extra memory associated
with each iterator with <code class="code">new</code> (changes the program with each iterator with <code class="code">new</code> (changes the program
semantics).</p></li></ol></div><p> semantics).</p></li></ol></div><p>
</p></li></ul></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug_mode.design.methods"></a>Methods</h3></div></div></div><p> </p></li></ul></div></div><div class="sect2" title="Methods"><div class="titlepage"><div><div><h3 class="title"><a id="debug_mode.design.methods"></a>Methods</h3></div></div></div><p>
</p><p>This section provides an overall view of the design of the </p><p>This section provides an overall view of the design of the
libstdc++ debug mode and details the relationship between design libstdc++ debug mode and details the relationship between design
decisions and the stated design goals.</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="debug_mode.design.methods.wrappers"></a>The Wrapper Model</h4></div></div></div><p>The libstdc++ debug mode uses a wrapper model where the decisions and the stated design goals.</p><div class="sect3" title="The Wrapper Model"><div class="titlepage"><div><div><h4 class="title"><a id="debug_mode.design.methods.wrappers"></a>The Wrapper Model</h4></div></div></div><p>The libstdc++ debug mode uses a wrapper model where the
debugging versions of library components (e.g., iterators and debugging versions of library components (e.g., iterators and
containers) form a layer on top of the release versions of the containers) form a layer on top of the release versions of the
library components. The debugging components first verify that the library components. The debugging components first verify that the
@ -109,19 +109,19 @@
their associated containers, which are necessary to detect certain their associated containers, which are necessary to detect certain
types of standard library usage errors such as dereferencing types of standard library usage errors such as dereferencing
past-the-end iterators or inserting into a container using an past-the-end iterators or inserting into a container using an
iterator from a different container.</p><div class="sect4" lang="en" xml:lang="en"><div class="titlepage"><div><div><h5 class="title"><a id="debug_mode.design.methods.safe_iter"></a>Safe Iterators</h5></div></div></div><p>Iterator wrappers provide a debugging layer over any iterator that iterator from a different container.</p><div class="sect4" title="Safe Iterators"><div class="titlepage"><div><div><h5 class="title"><a id="debug_mode.design.methods.safe_iter"></a>Safe Iterators</h5></div></div></div><p>Iterator wrappers provide a debugging layer over any iterator that
is attached to a particular container, and will manage the is attached to a particular container, and will manage the
information detailing the iterator's state (singular, information detailing the iterator's state (singular,
dereferenceable, etc.) and tracking the container to which the dereferenceable, etc.) and tracking the container to which the
iterator is attached. Because iterators have a well-defined, common iterator is attached. Because iterators have a well-defined, common
interface the iterator wrapper is implemented with the iterator interface the iterator wrapper is implemented with the iterator
adaptor class template <code class="code">__gnu_debug::_Safe_iterator</code>, adaptor class template <code class="code">__gnu_debug::_Safe_iterator</code>,
which takes two template parameters:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="code">Iterator</code>: The underlying iterator type, which must which takes two template parameters:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><code class="code">Iterator</code>: The underlying iterator type, which must
be either the <code class="code">iterator</code> or <code class="code">const_iterator</code> be either the <code class="code">iterator</code> or <code class="code">const_iterator</code>
typedef from the sequence type this iterator can reference.</p></li><li><p><code class="code">Sequence</code>: The type of sequence that this iterator typedef from the sequence type this iterator can reference.</p></li><li class="listitem"><p><code class="code">Sequence</code>: The type of sequence that this iterator
references. This sequence must be a safe sequence (discussed below) references. This sequence must be a safe sequence (discussed below)
whose <code class="code">iterator</code> or <code class="code">const_iterator</code> typedef whose <code class="code">iterator</code> or <code class="code">const_iterator</code> typedef
is the type of the safe iterator.</p></li></ul></div></div><div class="sect4" lang="en" xml:lang="en"><div class="titlepage"><div><div><h5 class="title"><a id="debug_mode.design.methods.safe_seq"></a>Safe Sequences (Containers)</h5></div></div></div><p>Container wrappers provide a debugging layer over a particular is the type of the safe iterator.</p></li></ul></div></div><div class="sect4" title="Safe Sequences (Containers)"><div class="titlepage"><div><div><h5 class="title"><a id="debug_mode.design.methods.safe_seq"></a>Safe Sequences (Containers)</h5></div></div></div><p>Container wrappers provide a debugging layer over a particular
container type. Because containers vary greatly in the member container type. Because containers vary greatly in the member
functions they support and the semantics of those member functions functions they support and the semantics of those member functions
(especially in the area of iterator invalidation), container (especially in the area of iterator invalidation), container
@ -157,7 +157,7 @@ template&lt;typename _Tp, typename _Allocator = allocator&lt;_Tp&gt;
// duplicate std::list interface with debugging semantics // duplicate std::list interface with debugging semantics
}; };
</pre></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="debug_mode.design.methods.precond"></a>Precondition Checking</h4></div></div></div><p>The debug mode operates primarily by checking the preconditions of </pre></div></div><div class="sect3" title="Precondition Checking"><div class="titlepage"><div><div><h4 class="title"><a id="debug_mode.design.methods.precond"></a>Precondition Checking</h4></div></div></div><p>The debug mode operates primarily by checking the preconditions of
all standard library operations that it supports. Preconditions that all standard library operations that it supports. Preconditions that
are always checked (regardless of whether or not we are in debug are always checked (regardless of whether or not we are in debug
mode) are checked via the <code class="code">__check_xxx</code> macros defined mode) are checked via the <code class="code">__check_xxx</code> macros defined
@ -184,7 +184,7 @@ template&lt;typename _Tp, typename _Allocator = allocator&lt;_Tp&gt;
cousin <code class="code">_GLIBCXX_DEBUG_PEDASSERT</code>, or the assertion cousin <code class="code">_GLIBCXX_DEBUG_PEDASSERT</code>, or the assertion
check macro that supports more advance formulation of error check macro that supports more advance formulation of error
messages, <code class="code">_GLIBCXX_DEBUG_VERIFY</code>. These macros are messages, <code class="code">_GLIBCXX_DEBUG_VERIFY</code>. These macros are
documented more thoroughly in the debug mode source code.</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="debug_mode.design.methods.coexistence"></a>Release- and debug-mode coexistence</h4></div></div></div><p>The libstdc++ debug mode is the first debug mode we know of that documented more thoroughly in the debug mode source code.</p></div><div class="sect3" title="Release- and debug-mode coexistence"><div class="titlepage"><div><div><h4 class="title"><a id="debug_mode.design.methods.coexistence"></a>Release- and debug-mode coexistence</h4></div></div></div><p>The libstdc++ debug mode is the first debug mode we know of that
is able to provide the "Per-use recompilation" (4) guarantee, that is able to provide the "Per-use recompilation" (4) guarantee, that
allows release-compiled and debug-compiled code to be linked and allows release-compiled and debug-compiled code to be linked and
executed together without causing unpredictable behavior. This executed together without causing unpredictable behavior. This
@ -200,7 +200,7 @@ template&lt;typename _Tp, typename _Allocator = allocator&lt;_Tp&gt;
recompilation but have had to give up some checking of the recompilation but have had to give up some checking of the
<code class="code">std::basic_string</code> class template (namely, safe <code class="code">std::basic_string</code> class template (namely, safe
iterators). iterators).
</p><div class="sect4" lang="en" xml:lang="en"><div class="titlepage"><div><div><h5 class="title"><a id="methods.coexistence.compile"></a>Compile-time coexistence of release- and debug-mode components</h5></div></div></div><p>Both the release-mode components and the debug-mode </p><div class="sect4" title="Compile-time coexistence of release- and debug-mode components"><div class="titlepage"><div><div><h5 class="title"><a id="methods.coexistence.compile"></a>Compile-time coexistence of release- and debug-mode components</h5></div></div></div><p>Both the release-mode components and the debug-mode
components need to exist within a single translation unit so that components need to exist within a single translation unit so that
the debug versions can wrap the release versions. However, only one the debug versions can wrap the release versions. However, only one
of these components should be user-visible at any particular of these components should be user-visible at any particular
@ -254,7 +254,7 @@ namespace std
// namespace __debug __attribute__ ((strong)); // namespace __debug __attribute__ ((strong));
inline namespace __debug { } inline namespace __debug { }
} }
</pre></div><div class="sect4" lang="en" xml:lang="en"><div class="titlepage"><div><div><h5 class="title"><a id="methods.coexistence.link"></a>Link- and run-time coexistence of release- and </pre></div><div class="sect4" title="Link- and run-time coexistence of release- and debug-mode components"><div class="titlepage"><div><div><h5 class="title"><a id="methods.coexistence.link"></a>Link- and run-time coexistence of release- and
debug-mode components</h5></div></div></div><p>Because each component has a distinct and separate release and debug-mode components</h5></div></div></div><p>Because each component has a distinct and separate release and
debug implementation, there are are no issues with link-time debug implementation, there are are no issues with link-time
coexistence: the separate namespaces result in different mangled coexistence: the separate namespaces result in different mangled
@ -301,11 +301,11 @@ test02()
release-mode <code class="code">basic_string</code>? While the answer could be release-mode <code class="code">basic_string</code>? While the answer could be
"both", and the difference hidden via renaming a la the "both", and the difference hidden via renaming a la the
debug/release containers, we must note two things about locale debug/release containers, we must note two things about locale
facets:</p><div class="orderedlist"><ol type="1"><li><p>They exist as shared state: one can create a facet in one facets:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>They exist as shared state: one can create a facet in one
translation unit and access the facet via the same type name in a translation unit and access the facet via the same type name in a
different translation unit. This means that we cannot have two different translation unit. This means that we cannot have two
different versions of locale facets, because the types would not be different versions of locale facets, because the types would not be
the same across debug/release-mode translation unit barriers.</p></li><li><p>They have virtual functions returning strings: these functions the same across debug/release-mode translation unit barriers.</p></li><li class="listitem"><p>They have virtual functions returning strings: these functions
mangle in the same way regardless of the mangling of their return mangle in the same way regardless of the mangling of their return
types (see above), and their precise signatures can be relied upon types (see above), and their precise signatures can be relied upon
by users because they may be overridden in derived classes.</p></li></ol></div><p>With the design of libstdc++ debug mode, we cannot effectively hide by users because they may be overridden in derived classes.</p></li></ol></div><p>With the design of libstdc++ debug mode, we cannot effectively hide
@ -316,24 +316,24 @@ test02()
changes. The effect on users is expected to be minimal, as there are changes. The effect on users is expected to be minimal, as there are
simple alternatives (e.g., <code class="code">__gnu_debug::basic_string</code>), simple alternatives (e.g., <code class="code">__gnu_debug::basic_string</code>),
and the usability benefit we gain from the ability to mix debug- and and the usability benefit we gain from the ability to mix debug- and
release-compiled translation units is enormous.</p></div><div class="sect4" lang="en" xml:lang="en"><div class="titlepage"><div><div><h5 class="title"><a id="methods.coexistence.alt"></a>Alternatives for Coexistence</h5></div></div></div><p>The coexistence scheme above was chosen over many alternatives, release-compiled translation units is enormous.</p></div><div class="sect4" title="Alternatives for Coexistence"><div class="titlepage"><div><div><h5 class="title"><a id="methods.coexistence.alt"></a>Alternatives for Coexistence</h5></div></div></div><p>The coexistence scheme above was chosen over many alternatives,
including language-only solutions and solutions that also required including language-only solutions and solutions that also required
extensions to the C++ front end. The following is a partial list of extensions to the C++ front end. The following is a partial list of
solutions, with justifications for our rejection of each.</p><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Completely separate debug/release libraries</em></span>: This is by solutions, with justifications for our rejection of each.</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Completely separate debug/release libraries</em></span>: This is by
far the simplest implementation option, where we do not allow any far the simplest implementation option, where we do not allow any
coexistence of debug- and release-compiled translation units in a coexistence of debug- and release-compiled translation units in a
program. This solution has an extreme negative affect on usability, program. This solution has an extreme negative affect on usability,
because it is quite likely that some libraries an application because it is quite likely that some libraries an application
depends on cannot be recompiled easily. This would not meet depends on cannot be recompiled easily. This would not meet
our <span class="emphasis"><em>usability</em></span> or <span class="emphasis"><em>minimize recompilation</em></span> criteria our <span class="emphasis"><em>usability</em></span> or <span class="emphasis"><em>minimize recompilation</em></span> criteria
well.</p></li><li><p><span class="emphasis"><em>Add a <code class="code">Debug</code> boolean template parameter</em></span>: well.</p></li><li class="listitem"><p><span class="emphasis"><em>Add a <code class="code">Debug</code> boolean template parameter</em></span>:
Partial specialization could be used to select the debug Partial specialization could be used to select the debug
implementation when <code class="code">Debug == true</code>, and the state implementation when <code class="code">Debug == true</code>, and the state
of <code class="code">_GLIBCXX_DEBUG</code> could decide whether the of <code class="code">_GLIBCXX_DEBUG</code> could decide whether the
default <code class="code">Debug</code> argument is <code class="code">true</code> default <code class="code">Debug</code> argument is <code class="code">true</code>
or <code class="code">false</code>. This option would break conformance with the or <code class="code">false</code>. This option would break conformance with the
C++ standard in both debug <span class="emphasis"><em>and</em></span> release modes. This would C++ standard in both debug <span class="emphasis"><em>and</em></span> release modes. This would
not meet our <span class="emphasis"><em>correctness</em></span> criteria. </p></li><li><p><span class="emphasis"><em>Packaging a debug flag in the allocators</em></span>: We could not meet our <span class="emphasis"><em>correctness</em></span> criteria. </p></li><li class="listitem"><p><span class="emphasis"><em>Packaging a debug flag in the allocators</em></span>: We could
reuse the <code class="code">Allocator</code> template parameter of containers reuse the <code class="code">Allocator</code> template parameter of containers
by adding a sentinel wrapper <code class="code">debug&lt;&gt;</code> that by adding a sentinel wrapper <code class="code">debug&lt;&gt;</code> that
signals the user's intention to use debugging, and pick up signals the user's intention to use debugging, and pick up
@ -344,18 +344,18 @@ test02()
(and more importantly), users that specify allocators instead of (and more importantly), users that specify allocators instead of
implicitly using the default allocator would not get debugging implicitly using the default allocator would not get debugging
containers. Thus this solution fails the <span class="emphasis"><em>correctness</em></span> containers. Thus this solution fails the <span class="emphasis"><em>correctness</em></span>
criteria.</p></li><li><p><span class="emphasis"><em>Define debug containers in another namespace, and employ criteria.</p></li><li class="listitem"><p><span class="emphasis"><em>Define debug containers in another namespace, and employ
a <code class="code">using</code> declaration (or directive)</em></span>: This is an a <code class="code">using</code> declaration (or directive)</em></span>: This is an
enticing option, because it would eliminate the need for enticing option, because it would eliminate the need for
the <code class="code">link_name</code> extension by aliasing the the <code class="code">link_name</code> extension by aliasing the
templates. However, there is no true template aliasing mechanism templates. However, there is no true template aliasing mechanism
is C++, because both <code class="code">using</code> directives and using is C++, because both <code class="code">using</code> directives and using
declarations disallow specialization. This method fails declarations disallow specialization. This method fails
the <span class="emphasis"><em>correctness</em></span> criteria.</p></li><li><p><span class="emphasis"><em> Use implementation-specific properties of anonymous the <span class="emphasis"><em>correctness</em></span> criteria.</p></li><li class="listitem"><p><span class="emphasis"><em> Use implementation-specific properties of anonymous
namespaces. </em></span> namespaces. </em></span>
See <a class="ulink" href="http://gcc.gnu.org/ml/libstdc++/2003-08/msg00004.html" target="_top"> this post See <a class="ulink" href="http://gcc.gnu.org/ml/libstdc++/2003-08/msg00004.html" target="_top"> this post
</a> </a>
This method fails the <span class="emphasis"><em>correctness</em></span> criteria.</p></li><li><p><span class="emphasis"><em>Extension: allow reopening on namespaces</em></span>: This would This method fails the <span class="emphasis"><em>correctness</em></span> criteria.</p></li><li class="listitem"><p><span class="emphasis"><em>Extension: allow reopening on namespaces</em></span>: This would
allow the debug mode to effectively alias the allow the debug mode to effectively alias the
namespace <code class="code">std</code> to an internal namespace, such namespace <code class="code">std</code> to an internal namespace, such
as <code class="code">__gnu_std_debug</code>, so that it is completely as <code class="code">__gnu_std_debug</code>, so that it is completely
@ -366,7 +366,7 @@ test02()
instance, the program would have two <code class="code">std::cout</code> instance, the program would have two <code class="code">std::cout</code>
objects! This solution would fails the <span class="emphasis"><em>minimize objects! This solution would fails the <span class="emphasis"><em>minimize
recompilation</em></span> requirement, because we would only be able to recompilation</em></span> requirement, because we would only be able to
support option (1) or (2).</p></li><li><p><span class="emphasis"><em>Extension: use link name</em></span>: This option involves support option (1) or (2).</p></li><li class="listitem"><p><span class="emphasis"><em>Extension: use link name</em></span>: This option involves
complicated re-naming between debug-mode and release-mode complicated re-naming between debug-mode and release-mode
components at compile time, and then a g++ extension called <span class="emphasis"><em> components at compile time, and then a g++ extension called <span class="emphasis"><em>
link name </em></span> to recover the original names at link time. There link name </em></span> to recover the original names at link time. There
@ -388,23 +388,23 @@ test02()
that breaks user specialization), and additional testcases will be that breaks user specialization), and additional testcases will be
added as we are able to identify other typical problem cases. These added as we are able to identify other typical problem cases. These
test cases will serve as a benchmark by which we can compare debug test cases will serve as a benchmark by which we can compare debug
mode implementations.</p></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug_mode.design.other"></a>Other Implementations</h3></div></div></div><p> mode implementations.</p></div></div></div><div class="sect2" title="Other Implementations"><div class="titlepage"><div><div><h3 class="title"><a id="debug_mode.design.other"></a>Other Implementations</h3></div></div></div><p>
</p><p> There are several existing implementations of debug modes for C++ </p><p> There are several existing implementations of debug modes for C++
standard library implementations, although none of them directly standard library implementations, although none of them directly
supports debugging for programs using libstdc++. The existing supports debugging for programs using libstdc++. The existing
implementations include:</p><div class="itemizedlist"><ul type="disc"><li><p><a class="ulink" href="http://www.mathcs.sjsu.edu/faculty/horstman/safestl.html" target="_top">SafeSTL</a>: implementations include:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><a class="ulink" href="http://www.mathcs.sjsu.edu/faculty/horstman/safestl.html" target="_top">SafeSTL</a>:
SafeSTL was the original debugging version of the Standard Template SafeSTL was the original debugging version of the Standard Template
Library (STL), implemented by Cay S. Horstmann on top of the Library (STL), implemented by Cay S. Horstmann on top of the
Hewlett-Packard STL. Though it inspired much work in this area, it Hewlett-Packard STL. Though it inspired much work in this area, it
has not been kept up-to-date for use with modern compilers or C++ has not been kept up-to-date for use with modern compilers or C++
standard library implementations.</p></li><li><p><a class="ulink" href="http://www.stlport.org/" target="_top">STLport</a>: STLport is a free standard library implementations.</p></li><li class="listitem"><p><a class="ulink" href="http://www.stlport.org/" target="_top">STLport</a>: STLport is a free
implementation of the C++ standard library derived from the <a class="ulink" href="http://www.sgi.com/tech/stl/" target="_top">SGI implementation</a>, and implementation of the C++ standard library derived from the <a class="ulink" href="http://www.sgi.com/tech/stl/" target="_top">SGI implementation</a>, and
ported to many other platforms. It includes a debug mode that uses a ported to many other platforms. It includes a debug mode that uses a
wrapper model (that in some ways inspired the libstdc++ debug mode wrapper model (that in some ways inspired the libstdc++ debug mode
design), although at the time of this writing the debug mode is design), although at the time of this writing the debug mode is
somewhat incomplete and meets only the "Full user recompilation" (2) somewhat incomplete and meets only the "Full user recompilation" (2)
recompilation guarantee by requiring the user to link against a recompilation guarantee by requiring the user to link against a
different library in debug mode vs. release mode.</p></li><li><p>Metrowerks CodeWarrior: The C++ standard library different library in debug mode vs. release mode.</p></li><li class="listitem"><p>Metrowerks CodeWarrior: The C++ standard library
that ships with Metrowerks CodeWarrior includes a debug mode. It is that ships with Metrowerks CodeWarrior includes a debug mode. It is
a full debug-mode implementation (including debugging for a full debug-mode implementation (including debugging for
CodeWarrior extensions) and is easy to use, although it meets only CodeWarrior extensions) and is easy to use, although it meets only

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Semantics</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="parallel_mode.html" title="Chapter 31. Parallel Mode" /><link rel="prev" href="parallel_mode.html" title="Chapter 31. Parallel Mode" /><link rel="next" href="bk01pt12ch31s03.html" title="Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Semantics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="parallel_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 31. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch31s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.semantics"></a>Semantics</h2></div></div></div><p> The parallel mode STL algorithms are currently not exception-safe, <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Semantics</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="parallel_mode.html" title="Chapter 31. Parallel Mode" /><link rel="prev" href="parallel_mode.html" title="Chapter 31. Parallel Mode" /><link rel="next" href="bk01pt12ch31s03.html" title="Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Semantics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="parallel_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 31. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch31s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Semantics"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.semantics"></a>Semantics</h2></div></div></div><p> The parallel mode STL algorithms are currently not exception-safe,
i.e. user-defined functors must not throw exceptions. i.e. user-defined functors must not throw exceptions.
Also, the order of execution is not guaranteed for some functions, of course. Also, the order of execution is not guaranteed for some functions, of course.
Therefore, user-defined functors should not have any concurrent side effects. Therefore, user-defined functors should not have any concurrent side effects.

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Design</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="parallel_mode.html" title="Chapter 31. Parallel Mode" /><link rel="prev" href="bk01pt12ch31s03.html" title="Using" /><link rel="next" href="bk01pt12ch31s05.html" title="Testing" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch31s03.html">Prev</a> </td><th width="60%" align="center">Chapter 31. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch31s05.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.design"></a>Design</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Design</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="parallel_mode.html" title="Chapter 31. Parallel Mode" /><link rel="prev" href="bk01pt12ch31s03.html" title="Using" /><link rel="next" href="bk01pt12ch31s05.html" title="Testing" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch31s03.html">Prev</a> </td><th width="60%" align="center">Chapter 31. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch31s05.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Design"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.design"></a>Design</h2></div></div></div><p>
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="parallel_mode.design.intro"></a>Interface Basics</h3></div></div></div><p> </p><div class="sect2" title="Interface Basics"><div class="titlepage"><div><div><h3 class="title"><a id="parallel_mode.design.intro"></a>Interface Basics</h3></div></div></div><p>
All parallel algorithms are intended to have signatures that are All parallel algorithms are intended to have signatures that are
equivalent to the ISO C++ algorithms replaced. For instance, the equivalent to the ISO C++ algorithms replaced. For instance, the
<code class="function">std::adjacent_find</code> function is declared as: <code class="function">std::adjacent_find</code> function is declared as:
@ -36,13 +36,13 @@ function, if no parallel functions are deemed worthy), based on either
compile-time or run-time conditions. compile-time or run-time conditions.
</p><p> The available signature options are specific for the different </p><p> The available signature options are specific for the different
algorithms/algorithm classes.</p><p> The general view of overloads for the parallel algorithms look like this: algorithms/algorithm classes.</p><p> The general view of overloads for the parallel algorithms look like this:
</p><div class="itemizedlist"><ul type="disc"><li><p>ISO C++ signature</p></li><li><p>ISO C++ signature + sequential_tag argument</p></li><li><p>ISO C++ signature + algorithm-specific tag type </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>ISO C++ signature</p></li><li class="listitem"><p>ISO C++ signature + sequential_tag argument</p></li><li class="listitem"><p>ISO C++ signature + algorithm-specific tag type
(several signatures)</p></li></ul></div><p> Please note that the implementation may use additional functions (several signatures)</p></li></ul></div><p> Please note that the implementation may use additional functions
(designated with the <code class="code">_switch</code> suffix) to dispatch from the (designated with the <code class="code">_switch</code> suffix) to dispatch from the
ISO C++ signature to the correct parallel version. Also, some of the ISO C++ signature to the correct parallel version. Also, some of the
algorithms do not have support for run-time conditions, so the last algorithms do not have support for run-time conditions, so the last
overload is therefore missing. overload is therefore missing.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="parallel_mode.design.tuning"></a>Configuration and Tuning</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="parallel_mode.design.tuning.omp"></a>Setting up the OpenMP Environment</h4></div></div></div><p> </p></div><div class="sect2" title="Configuration and Tuning"><div class="titlepage"><div><div><h3 class="title"><a id="parallel_mode.design.tuning"></a>Configuration and Tuning</h3></div></div></div><div class="sect3" title="Setting up the OpenMP Environment"><div class="titlepage"><div><div><h4 class="title"><a id="parallel_mode.design.tuning.omp"></a>Setting up the OpenMP Environment</h4></div></div></div><p>
Several aspects of the overall runtime environment can be manipulated Several aspects of the overall runtime environment can be manipulated
by standard OpenMP function calls. by standard OpenMP function calls.
</p><p> </p><p>
@ -72,7 +72,7 @@ Other parts of the runtime environment able to be manipulated include
nested parallelism (<code class="function">omp_set_nested</code>), schedule kind nested parallelism (<code class="function">omp_set_nested</code>), schedule kind
(<code class="function">omp_set_schedule</code>), and others. See the OpenMP (<code class="function">omp_set_schedule</code>), and others. See the OpenMP
documentation for more information. documentation for more information.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="parallel_mode.design.tuning.compile"></a>Compile Time Switches</h4></div></div></div><p> </p></div><div class="sect3" title="Compile Time Switches"><div class="titlepage"><div><div><h4 class="title"><a id="parallel_mode.design.tuning.compile"></a>Compile Time Switches</h4></div></div></div><p>
To force an algorithm to execute sequentially, even though parallelism To force an algorithm to execute sequentially, even though parallelism
is switched on in general via the macro <code class="constant">_GLIBCXX_PARALLEL</code>, is switched on in general via the macro <code class="constant">_GLIBCXX_PARALLEL</code>,
add <code class="classname">__gnu_parallel::sequential_tag()</code> to the end add <code class="classname">__gnu_parallel::sequential_tag()</code> to the end
@ -126,7 +126,7 @@ several additional choices, namely
<code class="code">__gnu_parallel::balanced_quicksort_tag</code>. <code class="code">__gnu_parallel::balanced_quicksort_tag</code>.
Multiway mergesort comes with the two splitting strategies for multi-way Multiway mergesort comes with the two splitting strategies for multi-way
merging. The quicksort options cannot be used for <code class="code">stable_sort</code>. merging. The quicksort options cannot be used for <code class="code">stable_sort</code>.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="parallel_mode.design.tuning.settings"></a>Run Time Settings and Defaults</h4></div></div></div><p> </p></div><div class="sect3" title="Run Time Settings and Defaults"><div class="titlepage"><div><div><h4 class="title"><a id="parallel_mode.design.tuning.settings"></a>Run Time Settings and Defaults</h4></div></div></div><p>
The default parallelization strategy, the choice of specific algorithm The default parallelization strategy, the choice of specific algorithm
strategy, the minimum threshold limits for individual parallel strategy, the minimum threshold limits for individual parallel
algorithms, and aspects of the underlying hardware can be specified as algorithms, and aspects of the underlying hardware can be specified as
@ -194,7 +194,7 @@ int main()
return 0; return 0;
} }
</pre></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="parallel_mode.design.impl"></a>Implementation Namespaces</h3></div></div></div><p> One namespace contain versions of code that are always </pre></div></div><div class="sect2" title="Implementation Namespaces"><div class="titlepage"><div><div><h3 class="title"><a id="parallel_mode.design.impl"></a>Implementation Namespaces</h3></div></div></div><p> One namespace contain versions of code that are always
explicitly sequential: explicitly sequential:
<code class="code">__gnu_serial</code>. <code class="code">__gnu_serial</code>.
</p><p> Two namespaces contain the parallel mode: </p><p> Two namespaces contain the parallel mode:

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Testing</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="parallel_mode.html" title="Chapter 31. Parallel Mode" /><link rel="prev" href="bk01pt12ch31s04.html" title="Design" /><link rel="next" href="profile_mode.html" title="Chapter 32. Profile Mode" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Testing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch31s04.html">Prev</a> </td><th width="60%" align="center">Chapter 31. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.test"></a>Testing</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Testing</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="parallel_mode.html" title="Chapter 31. Parallel Mode" /><link rel="prev" href="bk01pt12ch31s04.html" title="Design" /><link rel="next" href="profile_mode.html" title="Chapter 32. Profile Mode" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Testing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch31s04.html">Prev</a> </td><th width="60%" align="center">Chapter 31. Parallel Mode</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Testing"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.test"></a>Testing</h2></div></div></div><p>
Both the normal conformance and regression tests and the Both the normal conformance and regression tests and the
supplemental performance tests work. supplemental performance tests work.
</p><p> </p><p>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Design</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="next" href="bk01pt12ch32s03.html" title="Extensions for Custom Containers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.design"></a>Design</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Design</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="next" href="bk01pt12ch32s03.html" title="Extensions for Custom Containers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Design</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="profile_mode.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Design"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.design"></a>Design</h2></div></div></div><p>
</p><div class="table"><a id="id647548"></a><p class="title"><b>Table 32.1. Code Location</b></p><div class="table-contents"><table summary="Code Location" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Code Location</th><th align="left">Use</th></tr></thead><tbody><tr><td align="left"><code class="code">libstdc++-v3/include/std/*</code></td><td align="left">Preprocessor code to redirect to profile extension headers.</td></tr><tr><td align="left"><code class="code">libstdc++-v3/include/profile/*</code></td><td align="left">Profile extension public headers (map, vector, ...).</td></tr><tr><td align="left"><code class="code">libstdc++-v3/include/profile/impl/*</code></td><td align="left">Profile extension internals. Implementation files are </p><div class="table"><a id="id415042"></a><p class="title"><b>Table 32.1. Code Location</b></p><div class="table-contents"><table summary="Code Location" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Code Location</th><th align="left">Use</th></tr></thead><tbody><tr><td align="left"><code class="code">libstdc++-v3/include/std/*</code></td><td align="left">Preprocessor code to redirect to profile extension headers.</td></tr><tr><td align="left"><code class="code">libstdc++-v3/include/profile/*</code></td><td align="left">Profile extension public headers (map, vector, ...).</td></tr><tr><td align="left"><code class="code">libstdc++-v3/include/profile/impl/*</code></td><td align="left">Profile extension internals. Implementation files are
only included from <code class="code">impl/profiler.h</code>, which is the only only included from <code class="code">impl/profiler.h</code>, which is the only
file included from the public headers.</td></tr></tbody></table></div></div><br class="table-break" /><p> file included from the public headers.</td></tr></tbody></table></div></div><br class="table-break" /><p>
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.wrapper"></a>Wrapper Model</h3></div></div></div><p> </p><div class="sect2" title="Wrapper Model"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.wrapper"></a>Wrapper Model</h3></div></div></div><p>
In order to get our instrumented library version included instead of the In order to get our instrumented library version included instead of the
release one, release one,
we use the same wrapper model as the debug mode. we use the same wrapper model as the debug mode.
@ -25,7 +25,7 @@
Currently, mixing the profile mode with debug and parallel extensions is Currently, mixing the profile mode with debug and parallel extensions is
not allowed. Mixing them at compile time will result in preprocessor errors. not allowed. Mixing them at compile time will result in preprocessor errors.
Mixing them at link time is undefined. Mixing them at link time is undefined.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.instrumentation"></a>Instrumentation</h3></div></div></div><p> </p></div><div class="sect2" title="Instrumentation"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.instrumentation"></a>Instrumentation</h3></div></div></div><p>
Instead of instrumenting every public entry and exit point, Instead of instrumenting every public entry and exit point,
we chose to add instrumentation on demand, as needed we chose to add instrumentation on demand, as needed
by individual diagnostics. by individual diagnostics.
@ -44,7 +44,7 @@
</p><p> </p><p>
All the instrumentation on/off compile time switches live in All the instrumentation on/off compile time switches live in
<code class="code">include/profile/profiler.h</code>. <code class="code">include/profile/profiler.h</code>.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.rtlib"></a>Run Time Behavior</h3></div></div></div><p> </p></div><div class="sect2" title="Run Time Behavior"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.rtlib"></a>Run Time Behavior</h3></div></div></div><p>
For practical reasons, the instrumentation library processes the trace For practical reasons, the instrumentation library processes the trace
partially partially
rather than dumping it to disk in raw form. Each event is processed when rather than dumping it to disk in raw form. Each event is processed when
@ -63,25 +63,25 @@
For details, see For details, see
<a class="ulink" href="http://dx.doi.org/10.1109/CGO.2009.36" target="_top">paper presented at <a class="ulink" href="http://dx.doi.org/10.1109/CGO.2009.36" target="_top">paper presented at
CGO 2009</a>. CGO 2009</a>.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.analysis"></a>Analysis and Diagnostics</h3></div></div></div><p> </p></div><div class="sect2" title="Analysis and Diagnostics"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.analysis"></a>Analysis and Diagnostics</h3></div></div></div><p>
Final analysis takes place offline, and it is based entirely on the Final analysis takes place offline, and it is based entirely on the
generated trace and debugging info in the application binary. generated trace and debugging info in the application binary.
See section Diagnostics for a list of analysis types that we plan to support. See section Diagnostics for a list of analysis types that we plan to support.
</p><p> </p><p>
The input to the analysis is a table indexed by profile type and call stack. The input to the analysis is a table indexed by profile type and call stack.
The data type for each entry depends on the profile type. The data type for each entry depends on the profile type.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.cost-model"></a>Cost Model</h3></div></div></div><p> </p></div><div class="sect2" title="Cost Model"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.cost-model"></a>Cost Model</h3></div></div></div><p>
While it is likely that cost models become complex as we get into While it is likely that cost models become complex as we get into
more sophisticated analysis, we will try to follow a simple set of rules more sophisticated analysis, we will try to follow a simple set of rules
at the beginning. at the beginning.
</p><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Relative benefit estimation:</em></span> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Relative benefit estimation:</em></span>
The idea is to estimate or measure the cost of all operations The idea is to estimate or measure the cost of all operations
in the original scenario versus the scenario we advise to switch to. in the original scenario versus the scenario we advise to switch to.
For instance, when advising to change a vector to a list, an occurrence For instance, when advising to change a vector to a list, an occurrence
of the <code class="code">insert</code> method will generally count as a benefit. of the <code class="code">insert</code> method will generally count as a benefit.
Its magnitude depends on (1) the number of elements that get shifted Its magnitude depends on (1) the number of elements that get shifted
and (2) whether it triggers a reallocation. and (2) whether it triggers a reallocation.
</p></li><li><p><span class="emphasis"><em>Synthetic measurements:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Synthetic measurements:</em></span>
We will measure the relative difference between similar operations on We will measure the relative difference between similar operations on
different containers. We plan to write a battery of small tests that different containers. We plan to write a battery of small tests that
compare the times of the executions of similar methods on different compare the times of the executions of similar methods on different
@ -89,16 +89,16 @@
If this training phase is very quick, we may decide to perform it at If this training phase is very quick, we may decide to perform it at
library initialization time. The results can be cached on disk and reused library initialization time. The results can be cached on disk and reused
across runs. across runs.
</p></li><li><p><span class="emphasis"><em>Timers:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Timers:</em></span>
We plan to use timers for operations of larger granularity, such as sort. We plan to use timers for operations of larger granularity, such as sort.
For instance, we can switch between different sort methods on the fly For instance, we can switch between different sort methods on the fly
and report the one that performs best for each call context. and report the one that performs best for each call context.
</p></li><li><p><span class="emphasis"><em>Show stoppers:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Show stoppers:</em></span>
We may decide that the presence of an operation nullifies the advice. We may decide that the presence of an operation nullifies the advice.
For instance, when considering switching from <code class="code">set</code> to For instance, when considering switching from <code class="code">set</code> to
<code class="code">unordered_set</code>, if we detect use of operator <code class="code">++</code>, <code class="code">unordered_set</code>, if we detect use of operator <code class="code">++</code>,
we will simply not issue the advice, since this could signal that the use we will simply not issue the advice, since this could signal that the use
care require a sorted container.</p></li></ul></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.reports"></a>Reports</h3></div></div></div><p> care require a sorted container.</p></li></ul></div></div><div class="sect2" title="Reports"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.reports"></a>Reports</h3></div></div></div><p>
There are two types of reports. First, if we recognize a pattern for which There are two types of reports. First, if we recognize a pattern for which
we have a substitute that is likely to give better performance, we print we have a substitute that is likely to give better performance, we print
the advice and estimated performance gain. The advice is usually associated the advice and estimated performance gain. The advice is usually associated
@ -110,7 +110,7 @@ the top 10 <code class="code">multimap</code> locations
which have the worst data locality in actual traversals. which have the worst data locality in actual traversals.
Although this does not offer a solution, Although this does not offer a solution,
it helps the user focus on the key problems and ignore the uninteresting ones. it helps the user focus on the key problems and ignore the uninteresting ones.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.testing"></a>Testing</h3></div></div></div><p> </p></div><div class="sect2" title="Testing"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.testing"></a>Testing</h3></div></div></div><p>
First, we want to make sure we preserve the behavior of the release mode. First, we want to make sure we preserve the behavior of the release mode.
You can just type <code class="code">"make check-profile"</code>, which You can just type <code class="code">"make check-profile"</code>, which
builds and runs the whole test suite in profile mode. builds and runs the whole test suite in profile mode.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Extensions for Custom Containers</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="bk01pt12ch32s02.html" title="Design" /><link rel="next" href="bk01pt12ch32s04.html" title="Empirical Cost Model" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Extensions for Custom Containers</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s02.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s04.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.api"></a>Extensions for Custom Containers</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Extensions for Custom Containers</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="bk01pt12ch32s02.html" title="Design" /><link rel="next" href="bk01pt12ch32s04.html" title="Empirical Cost Model" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Extensions for Custom Containers</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s02.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s04.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Extensions for Custom Containers"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.api"></a>Extensions for Custom Containers</h2></div></div></div><p>
Many large projects use their own data structures instead of the ones in the Many large projects use their own data structures instead of the ones in the
standard library. If these data structures are similar in functionality standard library. If these data structures are similar in functionality
to the standard library, they can be instrumented with the same hooks to the standard library, they can be instrumented with the same hooks

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Empirical Cost Model</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="bk01pt12ch32s03.html" title="Extensions for Custom Containers" /><link rel="next" href="bk01pt12ch32s05.html" title="Implementation Issues" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Empirical Cost Model</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s03.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s05.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.cost_model"></a>Empirical Cost Model</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Empirical Cost Model</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="bk01pt12ch32s03.html" title="Extensions for Custom Containers" /><link rel="next" href="bk01pt12ch32s05.html" title="Implementation Issues" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Empirical Cost Model</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s03.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s05.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Empirical Cost Model"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.cost_model"></a>Empirical Cost Model</h2></div></div></div><p>
Currently, the cost model uses formulas with predefined relative weights Currently, the cost model uses formulas with predefined relative weights
for alternative containers or container implementations. For instance, for alternative containers or container implementations. For instance,
iterating through a vector is X times faster than iterating through a list. iterating through a vector is X times faster than iterating through a list.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Implementation Issues</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="bk01pt12ch32s04.html" title="Empirical Cost Model" /><link rel="next" href="bk01pt12ch32s06.html" title="Developer Information" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation Issues</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s04.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s06.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.implementation"></a>Implementation Issues</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.stack"></a>Stack Traces</h3></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Implementation Issues</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="bk01pt12ch32s04.html" title="Empirical Cost Model" /><link rel="next" href="bk01pt12ch32s06.html" title="Developer Information" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation Issues</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s04.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s06.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Implementation Issues"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.implementation"></a>Implementation Issues</h2></div></div></div><div class="sect2" title="Stack Traces"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.stack"></a>Stack Traces</h3></div></div></div><p>
Accurate stack traces are needed during profiling since we group events by Accurate stack traces are needed during profiling since we group events by
call context and dynamic instance. Without accurate traces, diagnostics call context and dynamic instance. Without accurate traces, diagnostics
may be hard to interpret. For instance, when giving advice to the user may be hard to interpret. For instance, when giving advice to the user
@ -11,24 +11,24 @@
<code class="code">_GLIBCXX_PROFILE_STACK_DEPTH</code> can be set <code class="code">_GLIBCXX_PROFILE_STACK_DEPTH</code> can be set
to 0 if you are willing to give up call context information, or to a small to 0 if you are willing to give up call context information, or to a small
positive value to reduce run time overhead. positive value to reduce run time overhead.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.symbols"></a>Symbolization of Instruction Addresses</h3></div></div></div><p> </p></div><div class="sect2" title="Symbolization of Instruction Addresses"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.symbols"></a>Symbolization of Instruction Addresses</h3></div></div></div><p>
The profiling and analysis phases use only instruction addresses. The profiling and analysis phases use only instruction addresses.
An external utility such as addr2line is needed to postprocess the result. An external utility such as addr2line is needed to postprocess the result.
We do not plan to add symbolization support in the profile extension. We do not plan to add symbolization support in the profile extension.
This would require access to symbol tables, debug information tables, This would require access to symbol tables, debug information tables,
external programs or libraries and other system dependent information. external programs or libraries and other system dependent information.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.concurrency"></a>Concurrency</h3></div></div></div><p> </p></div><div class="sect2" title="Concurrency"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.concurrency"></a>Concurrency</h3></div></div></div><p>
Our current model is simplistic, but precise. Our current model is simplistic, but precise.
We cannot afford to approximate because some of our diagnostics require We cannot afford to approximate because some of our diagnostics require
precise matching of operations to container instance and call context. precise matching of operations to container instance and call context.
During profiling, we keep a single information table per diagnostic. During profiling, we keep a single information table per diagnostic.
There is a single lock per information table. There is a single lock per information table.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.stdlib-in-proflib"></a>Using the Standard Library in the Instrumentation Implementation</h3></div></div></div><p> </p></div><div class="sect2" title="Using the Standard Library in the Instrumentation Implementation"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.stdlib-in-proflib"></a>Using the Standard Library in the Instrumentation Implementation</h3></div></div></div><p>
As much as we would like to avoid uses of stdlibc++ within our As much as we would like to avoid uses of stdlibc++ within our
instrumentation library, containers such as unordered_map are very instrumentation library, containers such as unordered_map are very
appealing. We plan to use them as long as they are named properly appealing. We plan to use them as long as they are named properly
to avoid ambiguity. to avoid ambiguity.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.malloc-hooks"></a>Malloc Hooks</h3></div></div></div><p> </p></div><div class="sect2" title="Malloc Hooks"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.malloc-hooks"></a>Malloc Hooks</h3></div></div></div><p>
User applications/libraries can provide malloc hooks. User applications/libraries can provide malloc hooks.
When the implementation of the malloc hooks uses stdlibc++, there can When the implementation of the malloc hooks uses stdlibc++, there can
be an infinite cycle between the profile mode instrumentation and the be an infinite cycle between the profile mode instrumentation and the
@ -42,7 +42,7 @@
uses non-recursive locks. uses non-recursive locks.
XXX: A definitive solution to this problem would be for the profile extension XXX: A definitive solution to this problem would be for the profile extension
to use a custom allocator internally, and perhaps not to use libstdc++. to use a custom allocator internally, and perhaps not to use libstdc++.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.construction-destruction"></a>Construction and Destruction of Global Objects</h3></div></div></div><p> </p></div><div class="sect2" title="Construction and Destruction of Global Objects"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.implementation.construction-destruction"></a>Construction and Destruction of Global Objects</h3></div></div></div><p>
The profiling library state is initialized at the first call to a profiling The profiling library state is initialized at the first call to a profiling
method. This allows us to record the construction of all global objects. method. This allows us to record the construction of all global objects.
However, we cannot do the same at destruction time. The trace is written However, we cannot do the same at destruction time. The trace is written

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Developer Information</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="bk01pt12ch32s05.html" title="Implementation Issues" /><link rel="next" href="bk01pt12ch32s07.html" title="Diagnostics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Developer Information</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s05.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s07.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.developer"></a>Developer Information</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.developer.bigpic"></a>Big Picture</h3></div></div></div><p>The profile mode headers are included with <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Developer Information</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="bk01pt12ch32s05.html" title="Implementation Issues" /><link rel="next" href="bk01pt12ch32s07.html" title="Diagnostics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Developer Information</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s05.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch32s07.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Developer Information"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.developer"></a>Developer Information</h2></div></div></div><div class="sect2" title="Big Picture"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.developer.bigpic"></a>Big Picture</h3></div></div></div><p>The profile mode headers are included with
<code class="code">-D_GLIBCXX_PROFILE</code> through preprocessor directives in <code class="code">-D_GLIBCXX_PROFILE</code> through preprocessor directives in
<code class="code">include/std/*</code>. <code class="code">include/std/*</code>.
</p><p>Instrumented implementations are provided in </p><p>Instrumented implementations are provided in
@ -14,7 +14,7 @@
must ensure (1) that the call is guarded against reentrance and must ensure (1) that the call is guarded against reentrance and
(2) that the call can be turned off at compile time using a (2) that the call can be turned off at compile time using a
<code class="code">-D_GLIBCXX_PROFILE_...</code> compiler option. <code class="code">-D_GLIBCXX_PROFILE_...</code> compiler option.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.developer.howto"></a>How To Add A Diagnostic</h3></div></div></div><p>Let's say the diagnostic name is "magic". </p></div><div class="sect2" title="How To Add A Diagnostic"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.developer.howto"></a>How To Add A Diagnostic</h3></div></div></div><p>Let's say the diagnostic name is "magic".
</p><p>If you need to instrument a header not already under </p><p>If you need to instrument a header not already under
<code class="code">include/profile/*</code>, first edit the corresponding header <code class="code">include/profile/*</code>, first edit the corresponding header
under <code class="code">include/std/</code> and add a preprocessor directive such under <code class="code">include/std/</code> and add a preprocessor directive such
@ -36,15 +36,15 @@
Hook names must start with <code class="code">__profcxx_</code>. Hook names must start with <code class="code">__profcxx_</code>.
Make sure they transform Make sure they transform
in no code with <code class="code">-D_NO_GLBICXX_PROFILE_MAGIC</code>. in no code with <code class="code">-D_NO_GLBICXX_PROFILE_MAGIC</code>.
Make sure all calls to any method in namespace <code class="code">__cxxprof_impl</code> Make sure all calls to any method in namespace <code class="code">__gnu_profile</code>
is protected against reentrance using macro is protected against reentrance using macro
<code class="code">_GLIBCXX_PROFILE_IMPL_REENTRANCE_GUARD</code>. <code class="code">_GLIBCXX_PROFILE_REENTRANCE_GUARD</code>.
All names of methods in namespace <code class="code">__cxxprof_impl</code> called from All names of methods in namespace <code class="code">__gnu_profile</code> called from
<code class="code">profiler.h</code> must start with <code class="code">__trace_magic_</code>. <code class="code">profiler.h</code> must start with <code class="code">__trace_magic_</code>.
</p><p>Add the implementation of the diagnostic. </p><p>Add the implementation of the diagnostic.
</p><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
Create new file <code class="code">include/profile/impl/profiler_magic.h</code>. Create new file <code class="code">include/profile/impl/profiler_magic.h</code>.
</p></li><li><p> </p></li><li class="listitem"><p>
Define class <code class="code">__magic_info: public __object_info_base</code>. Define class <code class="code">__magic_info: public __object_info_base</code>.
This is the representation of a line in the object table. This is the representation of a line in the object table.
The <code class="code">__merge</code> method is used to aggregate information The <code class="code">__merge</code> method is used to aggregate information
@ -53,10 +53,10 @@
as a number of small operations, e.g., number of words copied. as a number of small operations, e.g., number of words copied.
The <code class="code">__write</code> method is used to produce the raw trace. The <code class="code">__write</code> method is used to produce the raw trace.
The <code class="code">__advice</code> method is used to produce the advice string. The <code class="code">__advice</code> method is used to produce the advice string.
</p></li><li><p> </p></li><li class="listitem"><p>
Define class <code class="code">__magic_stack_info: public __magic_info</code>. Define class <code class="code">__magic_stack_info: public __magic_info</code>.
This defines the content of a line in the stack table. This defines the content of a line in the stack table.
</p></li><li><p> </p></li><li class="listitem"><p>
Define class <code class="code">__trace_magic: public __trace_base&lt;__magic_info, Define class <code class="code">__trace_magic: public __trace_base&lt;__magic_info,
__magic_stack_info&gt;</code>. __magic_stack_info&gt;</code>.
It defines the content of the trace associated with this diagnostic. It defines the content of the trace associated with this diagnostic.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Diagnostics</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="bk01pt12ch32s06.html" title="Developer Information" /><link rel="next" href="ext_allocators.html" title="Chapter 33. Allocators" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Diagnostics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s06.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="ext_allocators.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.diagnostics"></a>Diagnostics</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Diagnostics</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; profile&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="profile_mode.html" title="Chapter 32. Profile Mode" /><link rel="prev" href="bk01pt12ch32s06.html" title="Developer Information" /><link rel="next" href="ext_allocators.html" title="Chapter 33. Allocators" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Diagnostics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s06.html">Prev</a> </td><th width="60%" align="center">Chapter 32. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="ext_allocators.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Diagnostics"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.profile_mode.diagnostics"></a>Diagnostics</h2></div></div></div><p>
The table below presents all the diagnostics we intend to implement. The table below presents all the diagnostics we intend to implement.
Each diagnostic has a corresponding compile time switch Each diagnostic has a corresponding compile time switch
<code class="code">-D_GLIBCXX_PROFILE_&lt;diagnostic&gt;</code>. <code class="code">-D_GLIBCXX_PROFILE_&lt;diagnostic&gt;</code>.
@ -18,7 +18,7 @@
A high accuracy means that the diagnostic is unlikely to be wrong. A high accuracy means that the diagnostic is unlikely to be wrong.
These grades are not perfect. They are just meant to guide users with These grades are not perfect. They are just meant to guide users with
specific needs or time budgets. specific needs or time budgets.
</p><div class="table"><a id="id521055"></a><p class="title"><b>Table 32.2. Diagnostics</b></p><div class="table-contents"><table summary="Diagnostics" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Group</th><th align="left">Flag</th><th align="left">Benefit</th><th align="left">Cost</th><th align="left">Freq.</th><th align="left">Implemented</th></tr></thead><tbody><tr><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.containers" target="_top"> </p><div class="table"><a id="id447842"></a><p class="title"><b>Table 32.2. Diagnostics</b></p><div class="table-contents"><table summary="Diagnostics" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Group</th><th align="left">Flag</th><th align="left">Benefit</th><th align="left">Cost</th><th align="left">Freq.</th><th align="left">Implemented</th></tr></thead><tbody><tr><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.containers" target="_top">
CONTAINERS</a></td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.hashtable_too_small" target="_top"> CONTAINERS</a></td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.hashtable_too_small" target="_top">
HASHTABLE_TOO_SMALL</a></td><td align="left">10</td><td align="left">1</td><td align="left"> </td><td align="left">10</td><td align="left">yes</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.hashtable_too_large" target="_top"> HASHTABLE_TOO_SMALL</a></td><td align="left">10</td><td align="left">1</td><td align="left"> </td><td align="left">10</td><td align="left">yes</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.hashtable_too_large" target="_top">
HASHTABLE_TOO_LARGE</a></td><td align="left">5</td><td align="left">1</td><td align="left"> </td><td align="left">10</td><td align="left">yes</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.inefficient_hash" target="_top"> HASHTABLE_TOO_LARGE</a></td><td align="left">5</td><td align="left">1</td><td align="left"> </td><td align="left">10</td><td align="left">yes</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.inefficient_hash" target="_top">
@ -35,44 +35,44 @@
LOCALITY</a></td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.locality.sw_prefetch" target="_top"> LOCALITY</a></td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.locality.sw_prefetch" target="_top">
SOFTWARE_PREFETCH</a></td><td align="left">8</td><td align="left">8</td><td align="left"> </td><td align="left">5</td><td align="left">no</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.locality.linked" target="_top"> SOFTWARE_PREFETCH</a></td><td align="left">8</td><td align="left">8</td><td align="left"> </td><td align="left">5</td><td align="left">no</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.locality.linked" target="_top">
RBTREE_LOCALITY</a></td><td align="left">4</td><td align="left">8</td><td align="left"> </td><td align="left">5</td><td align="left">no</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.mthread.false_share" target="_top"> RBTREE_LOCALITY</a></td><td align="left">4</td><td align="left">8</td><td align="left"> </td><td align="left">5</td><td align="left">no</td></tr><tr><td align="left"> </td><td align="left"><a class="ulink" href="#manual.ext.profile_mode.analysis.mthread.false_share" target="_top">
FALSE_SHARING</a></td><td align="left">8</td><td align="left">10</td><td align="left"> </td><td align="left">10</td><td align="left">no</td></tr></tbody></table></div></div><br class="table-break" /><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.template"></a>Diagnostic Template</h3></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span> FALSE_SHARING</a></td><td align="left">8</td><td align="left">10</td><td align="left"> </td><td align="left">10</td><td align="left">no</td></tr></tbody></table></div></div><br class="table-break" /><div class="sect2" title="Diagnostic Template"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.template"></a>Diagnostic Template</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_&lt;diagnostic&gt;</code>. <code class="code">_GLIBCXX_PROFILE_&lt;diagnostic&gt;</code>.
</p></li><li><p><span class="emphasis"><em>Goal:</em></span> What problem will it diagnose? </p></li><li class="listitem"><p><span class="emphasis"><em>Goal:</em></span> What problem will it diagnose?
</p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span>. </p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span>.
What is the fundamental reason why this is a problem</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span> What is the fundamental reason why this is a problem</p></li><li class="listitem"><p><span class="emphasis"><em>Sample runtime reduction:</em></span>
Percentage reduction in execution time. When reduction is more than Percentage reduction in execution time. When reduction is more than
a constant factor, describe the reduction rate formula. a constant factor, describe the reduction rate formula.
</p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Recommendation:</em></span>
What would the advise look like?</p></li><li><p><span class="emphasis"><em>To instrument:</em></span> What would the advise look like?</p></li><li class="listitem"><p><span class="emphasis"><em>To instrument:</em></span>
What stdlibc++ components need to be instrumented?</p></li><li><p><span class="emphasis"><em>Analysis:</em></span> What stdlibc++ components need to be instrumented?</p></li><li class="listitem"><p><span class="emphasis"><em>Analysis:</em></span>
How do we decide when to issue the advice?</p></li><li><p><span class="emphasis"><em>Cost model:</em></span> How do we decide when to issue the advice?</p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
How do we measure benefits? Math goes here.</p></li><li><p><span class="emphasis"><em>Example:</em></span> How do we measure benefits? Math goes here.</p></li><li class="listitem"><p><span class="emphasis"><em>Example:</em></span>
</p><pre class="programlisting"> </p><pre class="programlisting">
program code program code
... ...
advice sample advice sample
</pre><p> </pre><p>
</p></li></ul></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.containers"></a>Containers</h3></div></div></div><p> </p></li></ul></div></div><div class="sect2" title="Containers"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.containers"></a>Containers</h3></div></div></div><p>
<span class="emphasis"><em>Switch:</em></span> <span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_CONTAINERS</code>. <code class="code">_GLIBCXX_PROFILE_CONTAINERS</code>.
</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.hashtable_too_small"></a>Hashtable Too Small</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span> </p><div class="sect3" title="Hashtable Too Small"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.hashtable_too_small"></a>Hashtable Too Small</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_HASHTABLE_TOO_SMALL</code>. <code class="code">_GLIBCXX_PROFILE_HASHTABLE_TOO_SMALL</code>.
</p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect hashtables with many </p></li><li class="listitem"><p><span class="emphasis"><em>Goal:</em></span> Detect hashtables with many
rehash operations, small construction size and large destruction size. rehash operations, small construction size and large destruction size.
</p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span> Rehash is very expensive. </p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span> Rehash is very expensive.
Read content, follow chains within bucket, evaluate hash function, place at Read content, follow chains within bucket, evaluate hash function, place at
new location in different order.</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span> 36%. new location in different order.</p></li><li class="listitem"><p><span class="emphasis"><em>Sample runtime reduction:</em></span> 36%.
Code similar to example below. Code similar to example below.
</p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Recommendation:</em></span>
Set initial size to N at construction site S. Set initial size to N at construction site S.
</p></li><li><p><span class="emphasis"><em>To instrument:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>To instrument:</em></span>
<code class="code">unordered_set, unordered_map</code> constructor, destructor, rehash. <code class="code">unordered_set, unordered_map</code> constructor, destructor, rehash.
</p></li><li><p><span class="emphasis"><em>Analysis:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Analysis:</em></span>
For each dynamic instance of <code class="code">unordered_[multi]set|map</code>, For each dynamic instance of <code class="code">unordered_[multi]set|map</code>,
record initial size and call context of the constructor. record initial size and call context of the constructor.
Record size increase, if any, after each relevant operation such as insert. Record size increase, if any, after each relevant operation such as insert.
Record the estimated rehash cost.</p></li><li><p><span class="emphasis"><em>Cost model:</em></span> Record the estimated rehash cost.</p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
Number of individual rehash operations * cost per rehash.</p></li><li><p><span class="emphasis"><em>Example:</em></span> Number of individual rehash operations * cost per rehash.</p></li><li class="listitem"><p><span class="emphasis"><em>Example:</em></span>
</p><pre class="programlisting"> </p><pre class="programlisting">
1 unordered_set&lt;int&gt; us; 1 unordered_set&lt;int&gt; us;
2 for (int k = 0; k &lt; 1000000; ++k) { 2 for (int k = 0; k &lt; 1000000; ++k) {
@ -81,24 +81,24 @@ advice sample
foo.cc:1: advice: Changing initial unordered_set size from 10 to 1000000 saves 1025530 rehash operations. foo.cc:1: advice: Changing initial unordered_set size from 10 to 1000000 saves 1025530 rehash operations.
</pre><p> </pre><p>
</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.hashtable_too_large"></a>Hashtable Too Large</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span> </p></li></ul></div></div><div class="sect3" title="Hashtable Too Large"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.hashtable_too_large"></a>Hashtable Too Large</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_HASHTABLE_TOO_LARGE</code>. <code class="code">_GLIBCXX_PROFILE_HASHTABLE_TOO_LARGE</code>.
</p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect hashtables which are </p></li><li class="listitem"><p><span class="emphasis"><em>Goal:</em></span> Detect hashtables which are
never filled up because fewer elements than reserved are ever never filled up because fewer elements than reserved are ever
inserted. inserted.
</p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span> Save memory, which </p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span> Save memory, which
is good in itself and may also improve memory reference performance through is good in itself and may also improve memory reference performance through
fewer cache and TLB misses.</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span> unknown. fewer cache and TLB misses.</p></li><li class="listitem"><p><span class="emphasis"><em>Sample runtime reduction:</em></span> unknown.
</p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Recommendation:</em></span>
Set initial size to N at construction site S. Set initial size to N at construction site S.
</p></li><li><p><span class="emphasis"><em>To instrument:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>To instrument:</em></span>
<code class="code">unordered_set, unordered_map</code> constructor, destructor, rehash. <code class="code">unordered_set, unordered_map</code> constructor, destructor, rehash.
</p></li><li><p><span class="emphasis"><em>Analysis:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Analysis:</em></span>
For each dynamic instance of <code class="code">unordered_[multi]set|map</code>, For each dynamic instance of <code class="code">unordered_[multi]set|map</code>,
record initial size and call context of the constructor, and correlate it record initial size and call context of the constructor, and correlate it
with its size at destruction time. with its size at destruction time.
</p></li><li><p><span class="emphasis"><em>Cost model:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
Number of iteration operations + memory saved.</p></li><li><p><span class="emphasis"><em>Example:</em></span> Number of iteration operations + memory saved.</p></li><li class="listitem"><p><span class="emphasis"><em>Example:</em></span>
</p><pre class="programlisting"> </p><pre class="programlisting">
1 vector&lt;unordered_set&lt;int&gt;&gt; v(100000, unordered_set&lt;int&gt;(100)) ; 1 vector&lt;unordered_set&lt;int&gt;&gt; v(100000, unordered_set&lt;int&gt;(100)) ;
2 for (int k = 0; k &lt; 100000; ++k) { 2 for (int k = 0; k &lt; 100000; ++k) {
@ -110,25 +110,25 @@ foo.cc:1: advice: Changing initial unordered_set size from 10 to 1000000 saves 1
foo.cc:1: advice: Changing initial unordered_set size from 100 to 10 saves N foo.cc:1: advice: Changing initial unordered_set size from 100 to 10 saves N
bytes of memory and M iteration steps. bytes of memory and M iteration steps.
</pre><p> </pre><p>
</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.inefficient_hash"></a>Inefficient Hash</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span> </p></li></ul></div></div><div class="sect3" title="Inefficient Hash"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.inefficient_hash"></a>Inefficient Hash</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_INEFFICIENT_HASH</code>. <code class="code">_GLIBCXX_PROFILE_INEFFICIENT_HASH</code>.
</p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect hashtables with polarized </p></li><li class="listitem"><p><span class="emphasis"><em>Goal:</em></span> Detect hashtables with polarized
distribution. distribution.
</p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span> A non-uniform </p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span> A non-uniform
distribution may lead to long chains, thus possibly increasing complexity distribution may lead to long chains, thus possibly increasing complexity
by a factor up to the number of elements. by a factor up to the number of elements.
</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span> factor up </p></li><li class="listitem"><p><span class="emphasis"><em>Sample runtime reduction:</em></span> factor up
to container size. to container size.
</p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> Change hash function </p></li><li class="listitem"><p><span class="emphasis"><em>Recommendation:</em></span> Change hash function
for container built at site S. Distribution score = N. Access score = S. for container built at site S. Distribution score = N. Access score = S.
Longest chain = C, in bucket B. Longest chain = C, in bucket B.
</p></li><li><p><span class="emphasis"><em>To instrument:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>To instrument:</em></span>
<code class="code">unordered_set, unordered_map</code> constructor, destructor, [], <code class="code">unordered_set, unordered_map</code> constructor, destructor, [],
insert, iterator. insert, iterator.
</p></li><li><p><span class="emphasis"><em>Analysis:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Analysis:</em></span>
Count the exact number of link traversals. Count the exact number of link traversals.
</p></li><li><p><span class="emphasis"><em>Cost model:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
Total number of links traversed.</p></li><li><p><span class="emphasis"><em>Example:</em></span> Total number of links traversed.</p></li><li class="listitem"><p><span class="emphasis"><em>Example:</em></span>
</p><pre class="programlisting"> </p><pre class="programlisting">
class dumb_hash { class dumb_hash {
public: public:
@ -141,22 +141,22 @@ class dumb_hash {
hs.find(i); hs.find(i);
} }
</pre><p> </pre><p>
</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.vector_too_small"></a>Vector Too Small</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span> </p></li></ul></div></div><div class="sect3" title="Vector Too Small"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.vector_too_small"></a>Vector Too Small</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_VECTOR_TOO_SMALL</code>. <code class="code">_GLIBCXX_PROFILE_VECTOR_TOO_SMALL</code>.
</p></li><li><p><span class="emphasis"><em>Goal:</em></span>Detect vectors with many </p></li><li class="listitem"><p><span class="emphasis"><em>Goal:</em></span>Detect vectors with many
resize operations, small construction size and large destruction size.. resize operations, small construction size and large destruction size..
</p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span>Resizing can be expensive. </p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span>Resizing can be expensive.
Copying large amounts of data takes time. Resizing many small vectors may Copying large amounts of data takes time. Resizing many small vectors may
have allocation overhead and affect locality.</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>%. have allocation overhead and affect locality.</p></li><li class="listitem"><p><span class="emphasis"><em>Sample runtime reduction:</em></span>%.
</p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Recommendation:</em></span>
Set initial size to N at construction site S.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span><code class="code">vector</code>. Set initial size to N at construction site S.</p></li><li class="listitem"><p><span class="emphasis"><em>To instrument:</em></span><code class="code">vector</code>.
</p></li><li><p><span class="emphasis"><em>Analysis:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Analysis:</em></span>
For each dynamic instance of <code class="code">vector</code>, For each dynamic instance of <code class="code">vector</code>,
record initial size and call context of the constructor. record initial size and call context of the constructor.
Record size increase, if any, after each relevant operation such as Record size increase, if any, after each relevant operation such as
<code class="code">push_back</code>. Record the estimated resize cost. <code class="code">push_back</code>. Record the estimated resize cost.
</p></li><li><p><span class="emphasis"><em>Cost model:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
Total number of words copied * time to copy a word.</p></li><li><p><span class="emphasis"><em>Example:</em></span> Total number of words copied * time to copy a word.</p></li><li class="listitem"><p><span class="emphasis"><em>Example:</em></span>
</p><pre class="programlisting"> </p><pre class="programlisting">
1 vector&lt;int&gt; v; 1 vector&lt;int&gt; v;
2 for (int k = 0; k &lt; 1000000; ++k) { 2 for (int k = 0; k &lt; 1000000; ++k) {
@ -166,21 +166,21 @@ class dumb_hash {
foo.cc:1: advice: Changing initial vector size from 10 to 1000000 saves foo.cc:1: advice: Changing initial vector size from 10 to 1000000 saves
copying 4000000 bytes and 20 memory allocations and deallocations. copying 4000000 bytes and 20 memory allocations and deallocations.
</pre><p> </pre><p>
</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.vector_too_large"></a>Vector Too Large</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span> </p></li></ul></div></div><div class="sect3" title="Vector Too Large"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.vector_too_large"></a>Vector Too Large</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_VECTOR_TOO_LARGE</code> <code class="code">_GLIBCXX_PROFILE_VECTOR_TOO_LARGE</code>
</p></li><li><p><span class="emphasis"><em>Goal:</em></span>Detect vectors which are </p></li><li class="listitem"><p><span class="emphasis"><em>Goal:</em></span>Detect vectors which are
never filled up because fewer elements than reserved are ever never filled up because fewer elements than reserved are ever
inserted. inserted.
</p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span>Save memory, which </p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span>Save memory, which
is good in itself and may also improve memory reference performance through is good in itself and may also improve memory reference performance through
fewer cache and TLB misses.</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>%. fewer cache and TLB misses.</p></li><li class="listitem"><p><span class="emphasis"><em>Sample runtime reduction:</em></span>%.
</p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Recommendation:</em></span>
Set initial size to N at construction site S.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span><code class="code">vector</code>. Set initial size to N at construction site S.</p></li><li class="listitem"><p><span class="emphasis"><em>To instrument:</em></span><code class="code">vector</code>.
</p></li><li><p><span class="emphasis"><em>Analysis:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Analysis:</em></span>
For each dynamic instance of <code class="code">vector</code>, For each dynamic instance of <code class="code">vector</code>,
record initial size and call context of the constructor, and correlate it record initial size and call context of the constructor, and correlate it
with its size at destruction time.</p></li><li><p><span class="emphasis"><em>Cost model:</em></span> with its size at destruction time.</p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
Total amount of memory saved.</p></li><li><p><span class="emphasis"><em>Example:</em></span> Total amount of memory saved.</p></li><li class="listitem"><p><span class="emphasis"><em>Example:</em></span>
</p><pre class="programlisting"> </p><pre class="programlisting">
1 vector&lt;vector&lt;int&gt;&gt; v(100000, vector&lt;int&gt;(100)) ; 1 vector&lt;vector&lt;int&gt;&gt; v(100000, vector&lt;int&gt;(100)) ;
2 for (int k = 0; k &lt; 100000; ++k) { 2 for (int k = 0; k &lt; 100000; ++k) {
@ -192,27 +192,27 @@ copying 4000000 bytes and 20 memory allocations and deallocations.
foo.cc:1: advice: Changing initial vector size from 100 to 10 saves N foo.cc:1: advice: Changing initial vector size from 100 to 10 saves N
bytes of memory and may reduce the number of cache and TLB misses. bytes of memory and may reduce the number of cache and TLB misses.
</pre><p> </pre><p>
</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.vector_to_hashtable"></a>Vector to Hashtable</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span> </p></li></ul></div></div><div class="sect3" title="Vector to Hashtable"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.vector_to_hashtable"></a>Vector to Hashtable</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_VECTOR_TO_HASHTABLE</code>. <code class="code">_GLIBCXX_PROFILE_VECTOR_TO_HASHTABLE</code>.
</p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect uses of </p></li><li class="listitem"><p><span class="emphasis"><em>Goal:</em></span> Detect uses of
<code class="code">vector</code> that can be substituted with <code class="code">unordered_set</code> <code class="code">vector</code> that can be substituted with <code class="code">unordered_set</code>
to reduce execution time. to reduce execution time.
</p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span>
Linear search in a vector is very expensive, whereas searching in a hashtable Linear search in a vector is very expensive, whereas searching in a hashtable
is very quick.</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>factor up is very quick.</p></li><li class="listitem"><p><span class="emphasis"><em>Sample runtime reduction:</em></span>factor up
to container size. to container size.
</p></li><li><p><span class="emphasis"><em>Recommendation:</em></span>Replace </p></li><li class="listitem"><p><span class="emphasis"><em>Recommendation:</em></span>Replace
<code class="code">vector</code> with <code class="code">unordered_set</code> at site S. <code class="code">vector</code> with <code class="code">unordered_set</code> at site S.
</p></li><li><p><span class="emphasis"><em>To instrument:</em></span><code class="code">vector</code> </p></li><li class="listitem"><p><span class="emphasis"><em>To instrument:</em></span><code class="code">vector</code>
operations and access methods.</p></li><li><p><span class="emphasis"><em>Analysis:</em></span> operations and access methods.</p></li><li class="listitem"><p><span class="emphasis"><em>Analysis:</em></span>
For each dynamic instance of <code class="code">vector</code>, For each dynamic instance of <code class="code">vector</code>,
record call context of the constructor. Issue the advice only if the record call context of the constructor. Issue the advice only if the
only methods called on this <code class="code">vector</code> are <code class="code">push_back</code>, only methods called on this <code class="code">vector</code> are <code class="code">push_back</code>,
<code class="code">insert</code> and <code class="code">find</code>. <code class="code">insert</code> and <code class="code">find</code>.
</p></li><li><p><span class="emphasis"><em>Cost model:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
Cost(vector::push_back) + cost(vector::insert) + cost(find, vector) - Cost(vector::push_back) + cost(vector::insert) + cost(find, vector) -
cost(unordered_set::insert) + cost(unordered_set::find). cost(unordered_set::insert) + cost(unordered_set::find).
</p></li><li><p><span class="emphasis"><em>Example:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Example:</em></span>
</p><pre class="programlisting"> </p><pre class="programlisting">
1 vector&lt;int&gt; v; 1 vector&lt;int&gt; v;
... ...
@ -223,24 +223,24 @@ bytes of memory and may reduce the number of cache and TLB misses.
foo.cc:1: advice: Changing "vector" to "unordered_set" will save about 500,000 foo.cc:1: advice: Changing "vector" to "unordered_set" will save about 500,000
comparisons. comparisons.
</pre><p> </pre><p>
</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.hashtable_to_vector"></a>Hashtable to Vector</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span> </p></li></ul></div></div><div class="sect3" title="Hashtable to Vector"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.hashtable_to_vector"></a>Hashtable to Vector</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_HASHTABLE_TO_VECTOR</code>. <code class="code">_GLIBCXX_PROFILE_HASHTABLE_TO_VECTOR</code>.
</p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect uses of </p></li><li class="listitem"><p><span class="emphasis"><em>Goal:</em></span> Detect uses of
<code class="code">unordered_set</code> that can be substituted with <code class="code">vector</code> <code class="code">unordered_set</code> that can be substituted with <code class="code">vector</code>
to reduce execution time. to reduce execution time.
</p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span>
Hashtable iterator is slower than vector iterator.</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>95%. Hashtable iterator is slower than vector iterator.</p></li><li class="listitem"><p><span class="emphasis"><em>Sample runtime reduction:</em></span>95%.
</p></li><li><p><span class="emphasis"><em>Recommendation:</em></span>Replace </p></li><li class="listitem"><p><span class="emphasis"><em>Recommendation:</em></span>Replace
<code class="code">unordered_set</code> with <code class="code">vector</code> at site S. <code class="code">unordered_set</code> with <code class="code">vector</code> at site S.
</p></li><li><p><span class="emphasis"><em>To instrument:</em></span><code class="code">unordered_set</code> </p></li><li class="listitem"><p><span class="emphasis"><em>To instrument:</em></span><code class="code">unordered_set</code>
operations and access methods.</p></li><li><p><span class="emphasis"><em>Analysis:</em></span> operations and access methods.</p></li><li class="listitem"><p><span class="emphasis"><em>Analysis:</em></span>
For each dynamic instance of <code class="code">unordered_set</code>, For each dynamic instance of <code class="code">unordered_set</code>,
record call context of the constructor. Issue the advice only if the record call context of the constructor. Issue the advice only if the
number of <code class="code">find</code>, <code class="code">insert</code> and <code class="code">[]</code> number of <code class="code">find</code>, <code class="code">insert</code> and <code class="code">[]</code>
operations on this <code class="code">unordered_set</code> are small relative to the operations on this <code class="code">unordered_set</code> are small relative to the
number of elements, and methods <code class="code">begin</code> or <code class="code">end</code> number of elements, and methods <code class="code">begin</code> or <code class="code">end</code>
are invoked (suggesting iteration).</p></li><li><p><span class="emphasis"><em>Cost model:</em></span> are invoked (suggesting iteration).</p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
Number of .</p></li><li><p><span class="emphasis"><em>Example:</em></span> Number of .</p></li><li class="listitem"><p><span class="emphasis"><em>Example:</em></span>
</p><pre class="programlisting"> </p><pre class="programlisting">
1 unordered_set&lt;int&gt; us; 1 unordered_set&lt;int&gt; us;
... ...
@ -252,27 +252,27 @@ comparisons.
foo.cc:1: advice: Changing "unordered_set" to "vector" will save about N foo.cc:1: advice: Changing "unordered_set" to "vector" will save about N
indirections and may achieve better data locality. indirections and may achieve better data locality.
</pre><p> </pre><p>
</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.vector_to_list"></a>Vector to List</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span> </p></li></ul></div></div><div class="sect3" title="Vector to List"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.vector_to_list"></a>Vector to List</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_VECTOR_TO_LIST</code>. <code class="code">_GLIBCXX_PROFILE_VECTOR_TO_LIST</code>.
</p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect cases where </p></li><li class="listitem"><p><span class="emphasis"><em>Goal:</em></span> Detect cases where
<code class="code">vector</code> could be substituted with <code class="code">list</code> for <code class="code">vector</code> could be substituted with <code class="code">list</code> for
better performance. better performance.
</p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span>
Inserting in the middle of a vector is expensive compared to inserting in a Inserting in the middle of a vector is expensive compared to inserting in a
list. list.
</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>factor up to </p></li><li class="listitem"><p><span class="emphasis"><em>Sample runtime reduction:</em></span>factor up to
container size. container size.
</p></li><li><p><span class="emphasis"><em>Recommendation:</em></span>Replace vector with list </p></li><li class="listitem"><p><span class="emphasis"><em>Recommendation:</em></span>Replace vector with list
at site S.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span><code class="code">vector</code> at site S.</p></li><li class="listitem"><p><span class="emphasis"><em>To instrument:</em></span><code class="code">vector</code>
operations and access methods.</p></li><li><p><span class="emphasis"><em>Analysis:</em></span> operations and access methods.</p></li><li class="listitem"><p><span class="emphasis"><em>Analysis:</em></span>
For each dynamic instance of <code class="code">vector</code>, For each dynamic instance of <code class="code">vector</code>,
record the call context of the constructor. Record the overhead of each record the call context of the constructor. Record the overhead of each
<code class="code">insert</code> operation based on current size and insert position. <code class="code">insert</code> operation based on current size and insert position.
Report instance with high insertion overhead. Report instance with high insertion overhead.
</p></li><li><p><span class="emphasis"><em>Cost model:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
(Sum(cost(vector::method)) - Sum(cost(list::method)), for (Sum(cost(vector::method)) - Sum(cost(list::method)), for
method in [push_back, insert, erase]) method in [push_back, insert, erase])
+ (Cost(iterate vector) - Cost(iterate list))</p></li><li><p><span class="emphasis"><em>Example:</em></span> + (Cost(iterate vector) - Cost(iterate list))</p></li><li class="listitem"><p><span class="emphasis"><em>Example:</em></span>
</p><pre class="programlisting"> </p><pre class="programlisting">
1 vector&lt;int&gt; v; 1 vector&lt;int&gt; v;
2 for (int i = 0; i &lt; 10000; ++i) { 2 for (int i = 0; i &lt; 10000; ++i) {
@ -282,22 +282,22 @@ indirections and may achieve better data locality.
foo.cc:1: advice: Changing "vector" to "list" will save about 5,000,000 foo.cc:1: advice: Changing "vector" to "list" will save about 5,000,000
operations. operations.
</pre><p> </pre><p>
</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.list_to_vector"></a>List to Vector</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span> </p></li></ul></div></div><div class="sect3" title="List to Vector"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.list_to_vector"></a>List to Vector</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_LIST_TO_VECTOR</code>. <code class="code">_GLIBCXX_PROFILE_LIST_TO_VECTOR</code>.
</p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect cases where </p></li><li class="listitem"><p><span class="emphasis"><em>Goal:</em></span> Detect cases where
<code class="code">list</code> could be substituted with <code class="code">vector</code> for <code class="code">list</code> could be substituted with <code class="code">vector</code> for
better performance. better performance.
</p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span>
Iterating through a vector is faster than through a list. Iterating through a vector is faster than through a list.
</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>64%. </p></li><li class="listitem"><p><span class="emphasis"><em>Sample runtime reduction:</em></span>64%.
</p></li><li><p><span class="emphasis"><em>Recommendation:</em></span>Replace list with vector </p></li><li class="listitem"><p><span class="emphasis"><em>Recommendation:</em></span>Replace list with vector
at site S.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span><code class="code">vector</code> at site S.</p></li><li class="listitem"><p><span class="emphasis"><em>To instrument:</em></span><code class="code">vector</code>
operations and access methods.</p></li><li><p><span class="emphasis"><em>Analysis:</em></span> operations and access methods.</p></li><li class="listitem"><p><span class="emphasis"><em>Analysis:</em></span>
Issue the advice if there are no <code class="code">insert</code> operations. Issue the advice if there are no <code class="code">insert</code> operations.
</p></li><li><p><span class="emphasis"><em>Cost model:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
(Sum(cost(vector::method)) - Sum(cost(list::method)), for (Sum(cost(vector::method)) - Sum(cost(list::method)), for
method in [push_back, insert, erase]) method in [push_back, insert, erase])
+ (Cost(iterate vector) - Cost(iterate list))</p></li><li><p><span class="emphasis"><em>Example:</em></span> + (Cost(iterate vector) - Cost(iterate list))</p></li><li class="listitem"><p><span class="emphasis"><em>Example:</em></span>
</p><pre class="programlisting"> </p><pre class="programlisting">
1 list&lt;int&gt; l; 1 list&lt;int&gt; l;
... ...
@ -309,23 +309,23 @@ operations.
foo.cc:1: advice: Changing "list" to "vector" will save about 1000000 indirect foo.cc:1: advice: Changing "list" to "vector" will save about 1000000 indirect
memory references. memory references.
</pre><p> </pre><p>
</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.assoc_ord_to_unord"></a>Ordered to Unordered Associative Container</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span> </p></li></ul></div></div><div class="sect3" title="Ordered to Unordered Associative Container"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.assoc_ord_to_unord"></a>Ordered to Unordered Associative Container</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_ORDERED_TO_UNORDERED</code>. <code class="code">_GLIBCXX_PROFILE_ORDERED_TO_UNORDERED</code>.
</p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect cases where ordered </p></li><li class="listitem"><p><span class="emphasis"><em>Goal:</em></span> Detect cases where ordered
associative containers can be replaced with unordered ones. associative containers can be replaced with unordered ones.
</p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span>
Insert and search are quicker in a hashtable than in Insert and search are quicker in a hashtable than in
a red-black tree.</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>52%. a red-black tree.</p></li><li class="listitem"><p><span class="emphasis"><em>Sample runtime reduction:</em></span>52%.
</p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Recommendation:</em></span>
Replace set with unordered_set at site S.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span> Replace set with unordered_set at site S.</p></li><li class="listitem"><p><span class="emphasis"><em>To instrument:</em></span>
<code class="code">set</code>, <code class="code">multiset</code>, <code class="code">map</code>, <code class="code">set</code>, <code class="code">multiset</code>, <code class="code">map</code>,
<code class="code">multimap</code> methods.</p></li><li><p><span class="emphasis"><em>Analysis:</em></span> <code class="code">multimap</code> methods.</p></li><li class="listitem"><p><span class="emphasis"><em>Analysis:</em></span>
Issue the advice only if we are not using operator <code class="code">++</code> on any Issue the advice only if we are not using operator <code class="code">++</code> on any
iterator on a particular <code class="code">[multi]set|map</code>. iterator on a particular <code class="code">[multi]set|map</code>.
</p></li><li><p><span class="emphasis"><em>Cost model:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
(Sum(cost(hashtable::method)) - Sum(cost(rbtree::method)), for (Sum(cost(hashtable::method)) - Sum(cost(rbtree::method)), for
method in [insert, erase, find]) method in [insert, erase, find])
+ (Cost(iterate hashtable) - Cost(iterate rbtree))</p></li><li><p><span class="emphasis"><em>Example:</em></span> + (Cost(iterate hashtable) - Cost(iterate rbtree))</p></li><li class="listitem"><p><span class="emphasis"><em>Example:</em></span>
</p><pre class="programlisting"> </p><pre class="programlisting">
1 set&lt;int&gt; s; 1 set&lt;int&gt; s;
2 for (int i = 0; i &lt; 100000; ++i) { 2 for (int i = 0; i &lt; 100000; ++i) {
@ -336,43 +336,43 @@ memory references.
7 sum += *s.find(i); 7 sum += *s.find(i);
8 } 8 }
</pre><p> </pre><p>
</p></li></ul></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.algorithms"></a>Algorithms</h3></div></div></div><p><span class="emphasis"><em>Switch:</em></span> </p></li></ul></div></div></div><div class="sect2" title="Algorithms"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.algorithms"></a>Algorithms</h3></div></div></div><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_ALGORITHMS</code>. <code class="code">_GLIBCXX_PROFILE_ALGORITHMS</code>.
</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.algorithms.sort"></a>Sort Algorithm Performance</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span> </p><div class="sect3" title="Sort Algorithm Performance"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.algorithms.sort"></a>Sort Algorithm Performance</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_SORT</code>. <code class="code">_GLIBCXX_PROFILE_SORT</code>.
</p></li><li><p><span class="emphasis"><em>Goal:</em></span> Give measure of sort algorithm </p></li><li class="listitem"><p><span class="emphasis"><em>Goal:</em></span> Give measure of sort algorithm
performance based on actual input. For instance, advise Radix Sort over performance based on actual input. For instance, advise Radix Sort over
Quick Sort for a particular call context. Quick Sort for a particular call context.
</p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span>
See papers: See papers:
<a class="ulink" href="http://portal.acm.org/citation.cfm?doid=1065944.1065981" target="_top"> <a class="ulink" href="http://portal.acm.org/citation.cfm?doid=1065944.1065981" target="_top">
A framework for adaptive algorithm selection in STAPL</a> and A framework for adaptive algorithm selection in STAPL</a> and
<a class="ulink" href="http://ieeexplore.ieee.org/search/wrapper.jsp?arnumber=4228227" target="_top"> <a class="ulink" href="http://ieeexplore.ieee.org/search/wrapper.jsp?arnumber=4228227" target="_top">
Optimizing Sorting with Machine Learning Algorithms</a>. Optimizing Sorting with Machine Learning Algorithms</a>.
</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>60%. </p></li><li class="listitem"><p><span class="emphasis"><em>Sample runtime reduction:</em></span>60%.
</p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> Change sort algorithm </p></li><li class="listitem"><p><span class="emphasis"><em>Recommendation:</em></span> Change sort algorithm
at site S from X Sort to Y Sort.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span> <code class="code">sort</code> at site S from X Sort to Y Sort.</p></li><li class="listitem"><p><span class="emphasis"><em>To instrument:</em></span> <code class="code">sort</code>
algorithm.</p></li><li><p><span class="emphasis"><em>Analysis:</em></span> algorithm.</p></li><li class="listitem"><p><span class="emphasis"><em>Analysis:</em></span>
Issue the advice if the cost model tells us that another sort algorithm Issue the advice if the cost model tells us that another sort algorithm
would do better on this input. Requires us to know what algorithm we would do better on this input. Requires us to know what algorithm we
are using in our sort implementation in release mode.</p></li><li><p><span class="emphasis"><em>Cost model:</em></span> are using in our sort implementation in release mode.</p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
Runtime(algo) for algo in [radix, quick, merge, ...]</p></li><li><p><span class="emphasis"><em>Example:</em></span> Runtime(algo) for algo in [radix, quick, merge, ...]</p></li><li class="listitem"><p><span class="emphasis"><em>Example:</em></span>
</p><pre class="programlisting"> </p><pre class="programlisting">
</pre><p> </pre><p>
</p></li></ul></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.locality"></a>Data Locality</h3></div></div></div><p><span class="emphasis"><em>Switch:</em></span> </p></li></ul></div></div></div><div class="sect2" title="Data Locality"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.locality"></a>Data Locality</h3></div></div></div><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_LOCALITY</code>. <code class="code">_GLIBCXX_PROFILE_LOCALITY</code>.
</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.locality.sw_prefetch"></a>Need Software Prefetch</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span> </p><div class="sect3" title="Need Software Prefetch"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.locality.sw_prefetch"></a>Need Software Prefetch</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_SOFTWARE_PREFETCH</code>. <code class="code">_GLIBCXX_PROFILE_SOFTWARE_PREFETCH</code>.
</p></li><li><p><span class="emphasis"><em>Goal:</em></span> Discover sequences of indirect </p></li><li class="listitem"><p><span class="emphasis"><em>Goal:</em></span> Discover sequences of indirect
memory accesses that are not regular, thus cannot be predicted by memory accesses that are not regular, thus cannot be predicted by
hardware prefetchers. hardware prefetchers.
</p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span>
Indirect references are hard to predict and are very expensive when they Indirect references are hard to predict and are very expensive when they
miss in caches.</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>25%. miss in caches.</p></li><li class="listitem"><p><span class="emphasis"><em>Sample runtime reduction:</em></span>25%.
</p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> Insert prefetch </p></li><li class="listitem"><p><span class="emphasis"><em>Recommendation:</em></span> Insert prefetch
instruction.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span> Vector iterator and instruction.</p></li><li class="listitem"><p><span class="emphasis"><em>To instrument:</em></span> Vector iterator and
access operator []. access operator [].
</p></li><li><p><span class="emphasis"><em>Analysis:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Analysis:</em></span>
First, get cache line size and page size from system. First, get cache line size and page size from system.
Then record iterator dereference sequences for which the value is a pointer. Then record iterator dereference sequences for which the value is a pointer.
For each sequence within a container, issue a warning if successive pointer For each sequence within a container, issue a warning if successive pointer
@ -389,9 +389,9 @@ memory references.
created by understanding the capability of the hardware prefetcher. created by understanding the capability of the hardware prefetcher.
This model could be trained automatically by running a set of synthetic This model could be trained automatically by running a set of synthetic
cases. cases.
</p></li><li><p><span class="emphasis"><em>Cost model:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
Total distance between pointer values of successive elements in vectors Total distance between pointer values of successive elements in vectors
of pointers.</p></li><li><p><span class="emphasis"><em>Example:</em></span> of pointers.</p></li><li class="listitem"><p><span class="emphasis"><em>Example:</em></span>
</p><pre class="programlisting"> </p><pre class="programlisting">
1 int zero = 0; 1 int zero = 0;
2 vector&lt;int*&gt; v(10000000, &amp;zero); 2 vector&lt;int*&gt; v(10000000, &amp;zero);
@ -404,28 +404,28 @@ memory references.
foo.cc:7: advice: Insert prefetch instruction. foo.cc:7: advice: Insert prefetch instruction.
</pre><p> </pre><p>
</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.locality.linked"></a>Linked Structure Locality</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span> </p></li></ul></div></div><div class="sect3" title="Linked Structure Locality"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.locality.linked"></a>Linked Structure Locality</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_RBTREE_LOCALITY</code>. <code class="code">_GLIBCXX_PROFILE_RBTREE_LOCALITY</code>.
</p></li><li><p><span class="emphasis"><em>Goal:</em></span> Give measure of locality of </p></li><li class="listitem"><p><span class="emphasis"><em>Goal:</em></span> Give measure of locality of
objects stored in linked structures (lists, red-black trees and hashtables) objects stored in linked structures (lists, red-black trees and hashtables)
with respect to their actual traversal patterns. with respect to their actual traversal patterns.
</p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span>Allocation can be tuned </p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span>Allocation can be tuned
to a specific traversal pattern, to result in better data locality. to a specific traversal pattern, to result in better data locality.
See paper: See paper:
<a class="ulink" href="http://www.springerlink.com/content/8085744l00x72662/" target="_top"> <a class="ulink" href="http://www.springerlink.com/content/8085744l00x72662/" target="_top">
Custom Memory Allocation for Free</a>. Custom Memory Allocation for Free</a>.
</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>30%. </p></li><li class="listitem"><p><span class="emphasis"><em>Sample runtime reduction:</em></span>30%.
</p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Recommendation:</em></span>
High scatter score N for container built at site S. High scatter score N for container built at site S.
Consider changing allocation sequence or choosing a structure conscious Consider changing allocation sequence or choosing a structure conscious
allocator.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span> Methods of all allocator.</p></li><li class="listitem"><p><span class="emphasis"><em>To instrument:</em></span> Methods of all
containers using linked structures.</p></li><li><p><span class="emphasis"><em>Analysis:</em></span> containers using linked structures.</p></li><li class="listitem"><p><span class="emphasis"><em>Analysis:</em></span>
First, get cache line size and page size from system. First, get cache line size and page size from system.
Then record the number of successive elements that are on different line Then record the number of successive elements that are on different line
or page, for each traversal method such as <code class="code">find</code>. Give advice or page, for each traversal method such as <code class="code">find</code>. Give advice
only if the ratio between this number and the number of total node hops only if the ratio between this number and the number of total node hops
is above a threshold.</p></li><li><p><span class="emphasis"><em>Cost model:</em></span> is above a threshold.</p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
Sum(same_cache_line(this,previous))</p></li><li><p><span class="emphasis"><em>Example:</em></span> Sum(same_cache_line(this,previous))</p></li><li class="listitem"><p><span class="emphasis"><em>Example:</em></span>
</p><pre class="programlisting"> </p><pre class="programlisting">
1 set&lt;int&gt; s; 1 set&lt;int&gt; s;
2 for (int i = 0; i &lt; 10000000; ++i) { 2 for (int i = 0; i &lt; 10000000; ++i) {
@ -449,58 +449,58 @@ foo.cc:7: advice: Insert prefetch instruction.
foo.cc:5: advice: High scatter score NNN for set built here. Consider changing foo.cc:5: advice: High scatter score NNN for set built here. Consider changing
the allocation sequence or switching to a structure conscious allocator. the allocation sequence or switching to a structure conscious allocator.
</pre><p> </pre><p>
</p></li></ul></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.mthread"></a>Multithreaded Data Access</h3></div></div></div><p> </p></li></ul></div></div></div><div class="sect2" title="Multithreaded Data Access"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.mthread"></a>Multithreaded Data Access</h3></div></div></div><p>
The diagnostics in this group are not meant to be implemented short term. The diagnostics in this group are not meant to be implemented short term.
They require compiler support to know when container elements are written They require compiler support to know when container elements are written
to. Instrumentation can only tell us when elements are referenced. to. Instrumentation can only tell us when elements are referenced.
</p><p><span class="emphasis"><em>Switch:</em></span> </p><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_MULTITHREADED</code>. <code class="code">_GLIBCXX_PROFILE_MULTITHREADED</code>.
</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.mthread.ddtest"></a>Data Dependence Violations at Container Level</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span> </p><div class="sect3" title="Data Dependence Violations at Container Level"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.mthread.ddtest"></a>Data Dependence Violations at Container Level</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_DDTEST</code>. <code class="code">_GLIBCXX_PROFILE_DDTEST</code>.
</p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect container elements </p></li><li class="listitem"><p><span class="emphasis"><em>Goal:</em></span> Detect container elements
that are referenced from multiple threads in the parallel region or that are referenced from multiple threads in the parallel region or
across parallel regions. across parallel regions.
</p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span>
Sharing data between threads requires communication and perhaps locking, Sharing data between threads requires communication and perhaps locking,
which may be expensive. which may be expensive.
</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>?%. </p></li><li class="listitem"><p><span class="emphasis"><em>Sample runtime reduction:</em></span>?%.
</p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> Change data </p></li><li class="listitem"><p><span class="emphasis"><em>Recommendation:</em></span> Change data
distribution or parallel algorithm.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span> Container access methods distribution or parallel algorithm.</p></li><li class="listitem"><p><span class="emphasis"><em>To instrument:</em></span> Container access methods
and iterators. and iterators.
</p></li><li><p><span class="emphasis"><em>Analysis:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Analysis:</em></span>
Keep a shadow for each container. Record iterator dereferences and Keep a shadow for each container. Record iterator dereferences and
container member accesses. Issue advice for elements referenced by container member accesses. Issue advice for elements referenced by
multiple threads. multiple threads.
See paper: <a class="ulink" href="http://portal.acm.org/citation.cfm?id=207110.207148" target="_top"> See paper: <a class="ulink" href="http://portal.acm.org/citation.cfm?id=207110.207148" target="_top">
The LRPD test: speculative run-time parallelization of loops with The LRPD test: speculative run-time parallelization of loops with
privatization and reduction parallelization</a>. privatization and reduction parallelization</a>.
</p></li><li><p><span class="emphasis"><em>Cost model:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
Number of accesses to elements referenced from multiple threads Number of accesses to elements referenced from multiple threads
</p></li><li><p><span class="emphasis"><em>Example:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Example:</em></span>
</p><pre class="programlisting"> </p><pre class="programlisting">
</pre><p> </pre><p>
</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.mthread.false_share"></a>False Sharing</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Switch:</em></span> </p></li></ul></div></div><div class="sect3" title="False Sharing"><div class="titlepage"><div><div><h4 class="title"><a id="manual.ext.profile_mode.analysis.mthread.false_share"></a>False Sharing</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_FALSE_SHARING</code>. <code class="code">_GLIBCXX_PROFILE_FALSE_SHARING</code>.
</p></li><li><p><span class="emphasis"><em>Goal:</em></span> Detect elements in the </p></li><li class="listitem"><p><span class="emphasis"><em>Goal:</em></span> Detect elements in the
same container which share a cache line, are written by at least one same container which share a cache line, are written by at least one
thread, and accessed by different threads. thread, and accessed by different threads.
</p></li><li><p><span class="emphasis"><em>Fundamentals:</em></span> Under these assumptions, </p></li><li class="listitem"><p><span class="emphasis"><em>Fundamentals:</em></span> Under these assumptions,
cache protocols require cache protocols require
communication to invalidate lines, which may be expensive. communication to invalidate lines, which may be expensive.
</p></li><li><p><span class="emphasis"><em>Sample runtime reduction:</em></span>68%. </p></li><li class="listitem"><p><span class="emphasis"><em>Sample runtime reduction:</em></span>68%.
</p></li><li><p><span class="emphasis"><em>Recommendation:</em></span> Reorganize container </p></li><li class="listitem"><p><span class="emphasis"><em>Recommendation:</em></span> Reorganize container
or use padding to avoid false sharing.</p></li><li><p><span class="emphasis"><em>To instrument:</em></span> Container access methods or use padding to avoid false sharing.</p></li><li class="listitem"><p><span class="emphasis"><em>To instrument:</em></span> Container access methods
and iterators. and iterators.
</p></li><li><p><span class="emphasis"><em>Analysis:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Analysis:</em></span>
First, get the cache line size. First, get the cache line size.
For each shared container, record all the associated iterator dereferences For each shared container, record all the associated iterator dereferences
and member access methods with the thread id. Compare the address lists and member access methods with the thread id. Compare the address lists
across threads to detect references in two different threads to the same across threads to detect references in two different threads to the same
cache line. Issue a warning only if the ratio to total references is cache line. Issue a warning only if the ratio to total references is
significant. Do the same for iterator dereference values if they are significant. Do the same for iterator dereference values if they are
pointers.</p></li><li><p><span class="emphasis"><em>Cost model:</em></span> pointers.</p></li><li class="listitem"><p><span class="emphasis"><em>Cost model:</em></span>
Number of accesses to same cache line from different threads. Number of accesses to same cache line from different threads.
</p></li><li><p><span class="emphasis"><em>Example:</em></span> </p></li><li class="listitem"><p><span class="emphasis"><em>Example:</em></span>
</p><pre class="programlisting"> </p><pre class="programlisting">
1 vector&lt;int&gt; v(2, 0); 1 vector&lt;int&gt; v(2, 0);
2 #pragma omp parallel for shared(v, SIZE) schedule(static, 1) 2 #pragma omp parallel for shared(v, SIZE) schedule(static, 1)
@ -512,7 +512,7 @@ OMP_NUM_THREADS=2 ./a.out
foo.cc:1: advice: Change container structure or padding to avoid false foo.cc:1: advice: Change container structure or padding to avoid false
sharing in multithreaded access at foo.cc:4. Detected N shared cache lines. sharing in multithreaded access at foo.cc:4. Detected N shared cache lines.
</pre><p> </pre><p>
</p></li></ul></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.statistics"></a>Statistics</h3></div></div></div><p> </p></li></ul></div></div></div><div class="sect2" title="Statistics"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.analysis.statistics"></a>Statistics</h3></div></div></div><p>
<span class="emphasis"><em>Switch:</em></span> <span class="emphasis"><em>Switch:</em></span>
<code class="code">_GLIBCXX_PROFILE_STATISTICS</code>. <code class="code">_GLIBCXX_PROFILE_STATISTICS</code>.
</p><p> </p><p>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>HP/SGI</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_containers.html" title="Chapter 34. Containers" /><link rel="prev" href="ext_containers.html" title="Chapter 34. Containers" /><link rel="next" href="bk01pt12ch34s03.html" title="Deprecated HP/SGI" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">HP/SGI</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_containers.html">Prev</a> </td><th width="60%" align="center">Chapter 34. Containers</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch34s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.sgi"></a>HP/SGI</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>HP/SGI</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_containers.html" title="Chapter 34. Containers" /><link rel="prev" href="ext_containers.html" title="Chapter 34. Containers" /><link rel="next" href="bk01pt12ch34s03.html" title="Deprecated HP/SGI" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">HP/SGI</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_containers.html">Prev</a> </td><th width="60%" align="center">Chapter 34. Containers</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch34s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="HP/SGI"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.sgi"></a>HP/SGI</h2></div></div></div><p>
</p><p>A few extensions and nods to backwards-compatibility have been made with </p><p>A few extensions and nods to backwards-compatibility have been made with
containers. Those dealing with older SGI-style allocators are dealt with containers. Those dealing with older SGI-style allocators are dealt with
elsewhere. The remaining ones all deal with bits: elsewhere. The remaining ones all deal with bits:

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Deprecated HP/SGI</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_containers.html" title="Chapter 34. Containers" /><link rel="prev" href="bk01pt12ch34s02.html" title="HP/SGI" /><link rel="next" href="ext_utilities.html" title="Chapter 35. Utilities" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Deprecated HP/SGI</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch34s02.html">Prev</a> </td><th width="60%" align="center">Chapter 34. Containers</th><td width="20%" align="right"> <a accesskey="n" href="ext_utilities.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.deprecated_sgi"></a>Deprecated HP/SGI</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Deprecated HP/SGI</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_containers.html" title="Chapter 34. Containers" /><link rel="prev" href="bk01pt12ch34s02.html" title="HP/SGI" /><link rel="next" href="ext_utilities.html" title="Chapter 35. Utilities" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Deprecated HP/SGI</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch34s02.html">Prev</a> </td><th width="60%" align="center">Chapter 34. Containers</th><td width="20%" align="right"> <a accesskey="n" href="ext_utilities.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Deprecated HP/SGI"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.deprecated_sgi"></a>Deprecated HP/SGI</h2></div></div></div><p>
The SGI hashing classes <code class="classname">hash_set</code> and The SGI hashing classes <code class="classname">hash_set</code> and
<code class="classname">hash_set</code> have been deprecated by the <code class="classname">hash_set</code> have been deprecated by the
unordered_set, unordered_multiset, unordered_map, unordered_set, unordered_multiset, unordered_map,
@ -37,7 +37,7 @@
functions, as well as some extra constructors specifying the number functions, as well as some extra constructors specifying the number
of buckets, etc. of buckets, etc.
</p><p>Why would you want to use a hashing class instead of the </p><p>Why would you want to use a hashing class instead of the
<span class="quote">normal</span>”implementations? Matt Austern writes: <span class="quote"><span class="quote">normal</span></span>implementations? Matt Austern writes:
</p><div class="blockquote"><blockquote class="blockquote"><p> </p><div class="blockquote"><blockquote class="blockquote"><p>
<span class="emphasis"><em>[W]ith a well chosen hash function, hash tables <span class="emphasis"><em>[W]ith a well chosen hash function, hash tables
generally provide much better average-case performance than generally provide much better average-case performance than

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Implementation</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_concurrency.html" title="Chapter 41. Concurrency" /><link rel="prev" href="ext_concurrency.html" title="Chapter 41. Concurrency" /><link rel="next" href="bk01pt12ch41s03.html" title="Use" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 41. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch41s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.impl"></a>Implementation</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.impl.atomic_fallbacks"></a>Using Builtin Atomic Functions</h3></div></div></div><p>The functions for atomic operations described above are either <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Implementation</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_concurrency.html" title="Chapter 41. Concurrency" /><link rel="prev" href="ext_concurrency.html" title="Chapter 41. Concurrency" /><link rel="next" href="bk01pt12ch41s03.html" title="Use" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_concurrency.html">Prev</a> </td><th width="60%" align="center">Chapter 41. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch41s03.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Implementation"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.impl"></a>Implementation</h2></div></div></div><div class="sect2" title="Using Builtin Atomic Functions"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.impl.atomic_fallbacks"></a>Using Builtin Atomic Functions</h3></div></div></div><p>The functions for atomic operations described above are either
implemented via compiler intrinsics (if the underlying host is implemented via compiler intrinsics (if the underlying host is
capable) or by library fallbacks.</p><p>Compiler intrinsics (builtins) are always preferred. However, as capable) or by library fallbacks.</p><p>Compiler intrinsics (builtins) are always preferred. However, as
the compiler builtins for atomics are not universally implemented, the compiler builtins for atomics are not universally implemented,
@ -18,14 +18,14 @@ If builtins are possible for bool-sized integral types,
If builtins are possible for int-sized integral types, If builtins are possible for int-sized integral types,
<code class="code">_GLIBCXX_ATOMIC_BUILTINS_4</code> will be defined. <code class="code">_GLIBCXX_ATOMIC_BUILTINS_4</code> will be defined.
</p><p>For the following hosts, intrinsics are enabled by default. </p><p>For the following hosts, intrinsics are enabled by default.
</p><div class="itemizedlist"><ul type="disc"><li><p>alpha</p></li><li><p>ia64</p></li><li><p>powerpc</p></li><li><p>s390</p></li></ul></div><p>For others, some form of <code class="code">-march</code> may work. On </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>alpha</p></li><li class="listitem"><p>ia64</p></li><li class="listitem"><p>powerpc</p></li><li class="listitem"><p>s390</p></li></ul></div><p>For others, some form of <code class="code">-march</code> may work. On
non-ancient x86 hardware, <code class="code">-march=native</code> usually does the non-ancient x86 hardware, <code class="code">-march=native</code> usually does the
trick.</p><p> For hosts without compiler intrinsics, but with capable trick.</p><p> For hosts without compiler intrinsics, but with capable
hardware, hand-crafted assembly is selected. This is the case for the following hosts: hardware, hand-crafted assembly is selected. This is the case for the following hosts:
</p><div class="itemizedlist"><ul type="disc"><li><p>cris</p></li><li><p>hppa</p></li><li><p>i386</p></li><li><p>i486</p></li><li><p>m48k</p></li><li><p>mips</p></li><li><p>sparc</p></li></ul></div><p>And for the rest, a simulated atomic lock via pthreads. </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>cris</p></li><li class="listitem"><p>hppa</p></li><li class="listitem"><p>i386</p></li><li class="listitem"><p>i486</p></li><li class="listitem"><p>m48k</p></li><li class="listitem"><p>mips</p></li><li class="listitem"><p>sparc</p></li></ul></div><p>And for the rest, a simulated atomic lock via pthreads.
</p><p> Detailed information about compiler intrinsics for atomic operations can be found in the GCC <a class="ulink" href="http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html" target="_top"> documentation</a>. </p><p> Detailed information about compiler intrinsics for atomic operations can be found in the GCC <a class="ulink" href="http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html" target="_top"> documentation</a>.
</p><p> More details on the library fallbacks from the porting <a class="link" href="internals.html#internals.thread_safety" title="Thread Safety">section</a>. </p><p> More details on the library fallbacks from the porting <a class="link" href="internals.html#internals.thread_safety" title="Thread Safety">section</a>.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.impl.thread"></a>Thread Abstraction</h3></div></div></div><p>A thin layer above IEEE 1003.1 (i.e. pthreads) is used to abstract </p></div><div class="sect2" title="Thread Abstraction"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.impl.thread"></a>Thread Abstraction</h3></div></div></div><p>A thin layer above IEEE 1003.1 (i.e. pthreads) is used to abstract
the thread interface for GCC. This layer is called "gthread," and is the thread interface for GCC. This layer is called "gthread," and is
comprised of one header file that wraps the host's default thread layer with comprised of one header file that wraps the host's default thread layer with
a POSIX-like interface. a POSIX-like interface.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Use</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_concurrency.html" title="Chapter 41. Concurrency" /><link rel="prev" href="bk01pt12ch41s02.html" title="Implementation" /><link rel="next" href="appendix_contributing.html" title="Appendix A.  Contributing" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Use</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch41s02.html">Prev</a> </td><th width="60%" align="center">Chapter 41. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="appendix_contributing.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.use"></a>Use</h2></div></div></div><p>Typical usage of the last two constructs is demonstrated as follows: <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Use</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="ext_concurrency.html" title="Chapter 41. Concurrency" /><link rel="prev" href="bk01pt12ch41s02.html" title="Implementation" /><link rel="next" href="appendix_contributing.html" title="Appendix A.  Contributing" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Use</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch41s02.html">Prev</a> </td><th width="60%" align="center">Chapter 41. Concurrency</th><td width="20%" align="right"> <a accesskey="n" href="appendix_contributing.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Use"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.use"></a>Use</h2></div></div></div><p>Typical usage of the last two constructs is demonstrated as follows:
</p><pre class="programlisting"> </p><pre class="programlisting">
#include &lt;ext/concurrence.h&gt; #include &lt;ext/concurrence.h&gt;

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="extensions.html" title="Part XII.  Extensions" /><link rel="next" href="ext_compile_checks.html" title="Chapter 29. Compile Time Checks" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="extensions.html">Prev</a> </td><th width="60%" align="center">Part XII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="extensions.html" title="Part XII.  Extensions" /><link rel="next" href="ext_compile_checks.html" title="Chapter 29. Compile Time Checks" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="extensions.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_compile_checks.html">Next</a></td></tr></table><hr /></div><div class="preface" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id646774"></a></h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="ext_compile_checks.html">Next</a></td></tr></table><hr /></div><div class="preface"><div class="titlepage"><div><div><h2 class="title"><a id="id455799"></a></h2></div></div></div><p>
Here we will make an attempt at describing the non-Standard extensions to Here we will make an attempt at describing the non-Standard extensions to
the library. Some of these are from SGI's STL, some of these are GNU's, the library. Some of these are from SGI's STL, some of these are GNU's,
and some just seemed to appear on the doorstep. and some just seemed to appear on the doorstep.
</p><p><span class="emphasis"><em>Before</em></span> you leap in and use any of these </p><p><span class="emphasis"><em>Before</em></span> you leap in and use any of these
extensions, be aware of two things: extensions, be aware of two things:
</p><div class="orderedlist"><ol type="1"><li><p> </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
Non-Standard means exactly that. Non-Standard means exactly that.
</p><p> </p><p>
The behavior, and the very The behavior, and the very
@ -18,7 +18,7 @@ extensions, be aware of two things:
revision of C++.) Also, other platforms, other compilers, other revision of C++.) Also, other platforms, other compilers, other
versions of g++ or libstdc++ may not recognize these names, or versions of g++ or libstdc++ may not recognize these names, or
treat them differently, or... treat them differently, or...
</p></li><li><p> </p></li><li class="listitem"><p>
You should know how to access these headers properly. You should know how to access these headers properly.
</p></li></ol></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="extensions.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_compile_checks.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Part XII.  </p></li></ol></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="extensions.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_compile_checks.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Part XII. 
Extensions Extensions

View File

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Bugs</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="status.html" title="Chapter 1. Status" /><link rel="prev" href="license.html" title="License" /><link rel="next" href="setup.html" title="Chapter 2. Setup" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Bugs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="license.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Status</th><td width="20%" align="right"> <a accesskey="n" href="setup.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.status.bugs"></a>Bugs</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.status.bugs.impl"></a>Implementation Bugs</h3></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Bugs</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="status.html" title="Chapter 1. Status" /><link rel="prev" href="license.html" title="License" /><link rel="next" href="setup.html" title="Chapter 2. Setup" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Bugs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="license.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Status</th><td width="20%" align="right"> <a accesskey="n" href="setup.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Bugs"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.status.bugs"></a>Bugs</h2></div></div></div><div class="sect2" title="Implementation Bugs"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.status.bugs.impl"></a>Implementation Bugs</h3></div></div></div><p>
Information on known bugs, details on efforts to fix them, and Information on known bugs, details on efforts to fix them, and
fixed bugs are all available as part of the GCC bug tracking fixed bugs are all available as part of the <a class="ulink" href="http://gcc.gnu.org/bugs/" target="_top">GCC bug tracking system</a>,
system, <a class="ulink" href="http://gcc.gnu.org/bugzilla" target="_top">bugzilla</a>, with the with the category set to <code class="literal">libstdc++</code>.
category set to <code class="literal">libstdc++</code>. </p></div><div class="sect2" title="Standard Bugs"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.status.bugs.iso"></a>Standard Bugs</h3></div></div></div><p>
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.status.bugs.iso"></a>Standard Bugs</h3></div></div></div><p>
Everybody's got issues. Even the C++ Standard Library. Everybody's got issues. Even the C++ Standard Library.
</p><p> </p><p>
The Library Working Group, or LWG, is the ISO subcommittee responsible The Library Working Group, or LWG, is the ISO subcommittee responsible
@ -248,7 +247,7 @@
</p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#409" target="_top">409</a>: </p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#409" target="_top">409</a>:
<span class="emphasis"><em>Closing an fstream should clear the error state</em></span> <span class="emphasis"><em>Closing an fstream should clear the error state</em></span>
</span></dt><dd><p>Have <code class="code">open</code> clear the error flags. </span></dt><dd><p>Have <code class="code">open</code> clear the error flags.
</p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-active.html#431" target="_top">431</a>: </p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-closed.html#431" target="_top">431</a>:
<span class="emphasis"><em>Swapping containers with unequal allocators</em></span> <span class="emphasis"><em>Swapping containers with unequal allocators</em></span>
</span></dt><dd><p>Implement Option 3, as per N1599. </span></dt><dd><p>Implement Option 3, as per N1599.
</p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#432" target="_top">432</a>: </p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#432" target="_top">432</a>:
@ -286,6 +285,11 @@
and Assignable?</em></span> and Assignable?</em></span>
</span></dt><dd><p>In case of input_iterator/output_iterator rely on Assignability of </span></dt><dd><p>In case of input_iterator/output_iterator rely on Assignability of
input_iterator' value_type. input_iterator' value_type.
</p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-active.html#539" target="_top">539</a>:
<span class="emphasis"><em>partial_sum and adjacent_difference should mention
requirements</em></span>
</span></dt><dd><p>We were almost doing the right thing, just use std::move
in adjacent_difference.
</p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#541" target="_top">541</a>: </p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#541" target="_top">541</a>:
<span class="emphasis"><em>shared_ptr template assignment and void</em></span> <span class="emphasis"><em>shared_ptr template assignment and void</em></span>
</span></dt><dd><p>Add an auto_ptr&lt;void&gt; specialization. </span></dt><dd><p>Add an auto_ptr&lt;void&gt; specialization.
@ -301,7 +305,7 @@
</p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#596" target="_top">596</a>: </p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#596" target="_top">596</a>:
<span class="emphasis"><em>27.8.1.3 Table 112 omits "a+" and "a+b" modes</em></span> <span class="emphasis"><em>27.8.1.3 Table 112 omits "a+" and "a+b" modes</em></span>
</span></dt><dd><p>Add the missing modes to fopen_mode. </span></dt><dd><p>Add the missing modes to fopen_mode.
</p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-active.html#630" target="_top">630</a>: </p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#630" target="_top">630</a>:
<span class="emphasis"><em>arrays of valarray</em></span> <span class="emphasis"><em>arrays of valarray</em></span>
</span></dt><dd><p>Implement the simple resolution. </span></dt><dd><p>Implement the simple resolution.
</p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#660" target="_top">660</a>: </p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#660" target="_top">660</a>:
@ -317,7 +321,7 @@
</p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#695" target="_top">695</a>: </p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#695" target="_top">695</a>:
<span class="emphasis"><em>ctype&lt;char&gt;::classic_table() not accessible</em></span> <span class="emphasis"><em>ctype&lt;char&gt;::classic_table() not accessible</em></span>
</span></dt><dd><p>Make the member functions table and classic_table public. </span></dt><dd><p>Make the member functions table and classic_table public.
</p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-active.html#696" target="_top">696</a>: </p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#696" target="_top">696</a>:
<span class="emphasis"><em>istream::operator&gt;&gt;(int&amp;) broken</em></span> <span class="emphasis"><em>istream::operator&gt;&gt;(int&amp;) broken</em></span>
</span></dt><dd><p>Implement the straightforward resolution. </span></dt><dd><p>Implement the straightforward resolution.
</p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#761" target="_top">761</a>: </p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#761" target="_top">761</a>:
@ -341,4 +345,8 @@
</p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#853" target="_top">853</a>: </p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-defects.html#853" target="_top">853</a>:
<span class="emphasis"><em>to_string needs updating with zero and one</em></span> <span class="emphasis"><em>to_string needs updating with zero and one</em></span>
</span></dt><dd><p>Update / add the signatures. </span></dt><dd><p>Update / add the signatures.
</p></dd><dt><span class="term"><a class="ulink" href="../ext/lwg-active.html#865" target="_top">865</a>:
<span class="emphasis"><em>More algorithms that throw away information</em></span>
</span></dt><dd><p>The traditional HP / SGI return type and value is blessed
by the resolution of the DR.
</p></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="license.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="status.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="setup.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">License </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 2. Setup</td></tr></table></div></body></html> </p></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="license.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="status.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="setup.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">License </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 2. Setup</td></tr></table></div></body></html>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>codecvt</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; codecvt&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="facets.html" title="Chapter 15. Facets aka Categories" /><link rel="prev" href="facets.html" title="Chapter 15. Facets aka Categories" /><link rel="next" href="messages.html" title="messages" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">codecvt</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="facets.html">Prev</a> </td><th width="60%" align="center">Chapter 15. Facets aka Categories</th><td width="20%" align="right"> <a accesskey="n" href="messages.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.localization.facet.codecvt"></a>codecvt</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>codecvt</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; codecvt&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="facets.html" title="Chapter 15. Facets aka Categories" /><link rel="prev" href="facets.html" title="Chapter 15. Facets aka Categories" /><link rel="next" href="messages.html" title="messages" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">codecvt</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="facets.html">Prev</a> </td><th width="60%" align="center">Chapter 15. Facets aka Categories</th><td width="20%" align="right"> <a accesskey="n" href="messages.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="codecvt"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.localization.facet.codecvt"></a>codecvt</h2></div></div></div><p>
The standard class codecvt attempts to address conversions between The standard class codecvt attempts to address conversions between
different character encoding schemes. In particular, the standard different character encoding schemes. In particular, the standard
attempts to detail conversions between the implementation-defined wide attempts to detail conversions between the implementation-defined wide
characters (hereafter referred to as wchar_t) and the standard type characters (hereafter referred to as wchar_t) and the standard type
char that is so beloved in classic “<span class="quote">C</span>” (which can now be char that is so beloved in classic <span class="quote"><span class="quote">C</span></span> (which can now be
referred to as narrow characters.) This document attempts to describe referred to as narrow characters.) This document attempts to describe
how the GNU libstdc++ implementation deals with the conversion between how the GNU libstdc++ implementation deals with the conversion between
wide and narrow characters, and also presents a framework for dealing wide and narrow characters, and also presents a framework for dealing
@ -14,7 +14,7 @@ including Unicode and UTF8. Design issues and requirements are
addressed, and examples of correct usage for both the required addressed, and examples of correct usage for both the required
specializations for wide and narrow characters and the specializations for wide and narrow characters and the
implementation-provided extended functionality are given. implementation-provided extended functionality are given.
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="facet.codecvt.req"></a>Requirements</h3></div></div></div><p> </p><div class="sect2" title="Requirements"><div class="titlepage"><div><div><h3 class="title"><a id="facet.codecvt.req"></a>Requirements</h3></div></div></div><p>
Around page 425 of the C++ Standard, this charming heading comes into view: Around page 425 of the C++ Standard, this charming heading comes into view:
</p><div class="blockquote"><blockquote class="blockquote"><p> </p><div class="blockquote"><blockquote class="blockquote"><p>
22.2.1.5 - Template class codecvt 22.2.1.5 - Template class codecvt
@ -60,7 +60,7 @@ third template parameter, stateT.</p><p>
Two: The required conversions, by specifying mbstate_t as the third Two: The required conversions, by specifying mbstate_t as the third
template parameter, imply an implementation strategy that is mostly template parameter, imply an implementation strategy that is mostly
(or wholly) based on the underlying C library, and the functions (or wholly) based on the underlying C library, and the functions
mcsrtombs and wcsrtombs in particular.</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="facet.codecvt.design"></a>Design</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="codecvt.design.wchar_t_size"></a><span class="type">wchar_t</span> Size</h4></div></div></div><p> mcsrtombs and wcsrtombs in particular.</p></div><div class="sect2" title="Design"><div class="titlepage"><div><div><h3 class="title"><a id="facet.codecvt.design"></a>Design</h3></div></div></div><div class="sect3" title="wchar_t Size"><div class="titlepage"><div><div><h4 class="title"><a id="codecvt.design.wchar_t_size"></a><span class="type">wchar_t</span> Size</h4></div></div></div><p>
The simple implementation detail of wchar_t's size seems to The simple implementation detail of wchar_t's size seems to
repeatedly confound people. Many systems use a two byte, repeatedly confound people. Many systems use a two byte,
unsigned integral type to represent wide characters, and use an unsigned integral type to represent wide characters, and use an
@ -72,7 +72,7 @@ mcsrtombs and wcsrtombs in particular.</p></div><div class="sect2" lang="en" xml
size for the type wchar_t. size for the type wchar_t.
</p><p> </p><p>
Thus, portable C++ code cannot assume a byte size (or endianness) either. Thus, portable C++ code cannot assume a byte size (or endianness) either.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="codecvt.design.unicode"></a>Support for Unicode</h4></div></div></div><p> </p></div><div class="sect3" title="Support for Unicode"><div class="titlepage"><div><div><h4 class="title"><a id="codecvt.design.unicode"></a>Support for Unicode</h4></div></div></div><p>
Probably the most frequently asked question about code conversion Probably the most frequently asked question about code conversion
is: "So dudes, what's the deal with Unicode strings?" is: "So dudes, what's the deal with Unicode strings?"
The dude part is optional, but apparently the usefulness of The dude part is optional, but apparently the usefulness of
@ -89,7 +89,7 @@ mcsrtombs and wcsrtombs in particular.</p></div><div class="sect2" lang="en" xml
needed is some kind of generalized type that accounts for the needed is some kind of generalized type that accounts for the
issues that abstract encodings will need. The minimum information issues that abstract encodings will need. The minimum information
that is required includes: that is required includes:
</p><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
Identifiers for each of the codesets involved in the Identifiers for each of the codesets involved in the
conversion. For example, using the iconv family of functions conversion. For example, using the iconv family of functions
from the Single Unix Specification (what used to be called from the Single Unix Specification (what used to be called
@ -115,32 +115,32 @@ encodings (i.e. "UCS-2" and "UTF-8") are necessary,
although for other, although for other,
non-iconv implementations a table of enumerated values or some other non-iconv implementations a table of enumerated values or some other
mechanism may be required. mechanism may be required.
</p></li><li><p> </p></li><li class="listitem"><p>
Maximum length of the identifying string literal. Maximum length of the identifying string literal.
</p></li><li><p> </p></li><li class="listitem"><p>
Some encodings require explicit endian-ness. As such, some kind Some encodings require explicit endian-ness. As such, some kind
of endian marker or other byte-order marker will be necessary. See of endian marker or other byte-order marker will be necessary. See
"Footnotes for C/C++ developers" in Haible for more information on "Footnotes for C/C++ developers" in Haible for more information on
UCS-2/Unicode endian issues. (Summary: big endian seems most likely, UCS-2/Unicode endian issues. (Summary: big endian seems most likely,
however implementations, most notably Microsoft, vary.) however implementations, most notably Microsoft, vary.)
</p></li><li><p> </p></li><li class="listitem"><p>
Types representing the conversion state, for conversions involving Types representing the conversion state, for conversions involving
the machinery in the "C" library, or the conversion descriptor, for the machinery in the "C" library, or the conversion descriptor, for
conversions using iconv (such as the type iconv_t.) Note that the conversions using iconv (such as the type iconv_t.) Note that the
conversion descriptor encodes more information than a simple encoding conversion descriptor encodes more information than a simple encoding
state type. state type.
</p></li><li><p> </p></li><li class="listitem"><p>
Conversion descriptors for both directions of encoding. (i.e., both Conversion descriptors for both directions of encoding. (i.e., both
UCS-2 to UTF-8 and UTF-8 to UCS-2.) UCS-2 to UTF-8 and UTF-8 to UCS-2.)
</p></li><li><p> </p></li><li class="listitem"><p>
Something to indicate if the conversion requested if valid. Something to indicate if the conversion requested if valid.
</p></li><li><p> </p></li><li class="listitem"><p>
Something to represent if the conversion descriptors are valid. Something to represent if the conversion descriptors are valid.
</p></li><li><p> </p></li><li class="listitem"><p>
Some way to enforce strict type checking on the internal and Some way to enforce strict type checking on the internal and
external types. As part of this, the size of the internal and external types. As part of this, the size of the internal and
external types will need to be known. external types will need to be known.
</p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="codecvt.design.issues"></a>Other Issues</h4></div></div></div><p> </p></li></ul></div></div><div class="sect3" title="Other Issues"><div class="titlepage"><div><div><h4 class="title"><a id="codecvt.design.issues"></a>Other Issues</h4></div></div></div><p>
In addition, multi-threaded and multi-locale environments also impact In addition, multi-threaded and multi-locale environments also impact
the design and requirements for code conversions. In particular, they the design and requirements for code conversions. In particular, they
affect the required specialization codecvt&lt;wchar_t, char, mbstate_t&gt; affect the required specialization codecvt&lt;wchar_t, char, mbstate_t&gt;
@ -172,7 +172,7 @@ 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></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="facet.codecvt.impl"></a>Implementation</h3></div></div></div><p> </p></div></div><div class="sect2" title="Implementation"><div class="titlepage"><div><div><h3 class="title"><a id="facet.codecvt.impl"></a>Implementation</h3></div></div></div><p>
The two required specializations are implemented as follows: The two required specializations are implemented as follows:
</p><p> </p><p>
<code class="code"> <code class="code">
@ -274,7 +274,7 @@ Definitions for all the required codecvt member functions are provided
for this specialization, and usage of codecvt&lt;internal character type, for this specialization, and usage of codecvt&lt;internal character type,
external character type, encoding_state&gt; is consistent with other external character type, encoding_state&gt; is consistent with other
codecvt usage. codecvt usage.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="facet.codecvt.use"></a>Use</h3></div></div></div><p>A conversions involving string literal.</p><pre class="programlisting"> </p></div><div class="sect2" title="Use"><div class="titlepage"><div><div><h3 class="title"><a id="facet.codecvt.use"></a>Use</h3></div></div></div><p>A conversions involving string literal.</p><pre class="programlisting">
typedef codecvt_base::result result; typedef codecvt_base::result result;
typedef unsigned short unicode_t; typedef unsigned short unicode_t;
typedef unicode_t int_type; typedef unicode_t int_type;
@ -311,67 +311,67 @@ codecvt usage.
VERIFY( !int_traits::compare(i_arr, i_lit, size) ); VERIFY( !int_traits::compare(i_arr, i_lit, size) );
VERIFY( efrom_next == e_lit + size ); VERIFY( efrom_next == e_lit + size );
VERIFY( ito_next == i_arr + size ); VERIFY( ito_next == i_arr + size );
</pre></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="facet.codecvt.future"></a>Future</h3></div></div></div><div class="itemizedlist"><ul type="disc"><li><p> </pre></div><div class="sect2" title="Future"><div class="titlepage"><div><div><h3 class="title"><a id="facet.codecvt.future"></a>Future</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
a. things that are sketchy, or remain unimplemented: a. things that are sketchy, or remain unimplemented:
do_encoding, max_length and length member functions do_encoding, max_length and length member functions
are only weakly implemented. I have no idea how to do are only weakly implemented. I have no idea how to do
this correctly, and in a generic manner. Nathan? this correctly, and in a generic manner. Nathan?
</p></li><li><p> </p></li><li class="listitem"><p>
b. conversions involving std::string b. conversions involving std::string
</p><div class="itemizedlist"><ul type="circle"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="circle"><li class="listitem"><p>
how should operators != and == work for string of how should operators != and == work for string of
different/same encoding? different/same encoding?
</p></li><li><p> </p></li><li class="listitem"><p>
what is equal? A byte by byte comparison or an what is equal? A byte by byte comparison or an
encoding then byte comparison? encoding then byte comparison?
</p></li><li><p> </p></li><li class="listitem"><p>
conversions between narrow, wide, and unicode strings conversions between narrow, wide, and unicode strings
</p></li></ul></div></li><li><p> </p></li></ul></div></li><li class="listitem"><p>
c. conversions involving std::filebuf and std::ostream c. conversions involving std::filebuf and std::ostream
</p><div class="itemizedlist"><ul type="circle"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="circle"><li class="listitem"><p>
how to initialize the state object in a how to initialize the state object in a
standards-conformant manner? standards-conformant manner?
</p></li><li><p> </p></li><li class="listitem"><p>
how to synchronize the "C" and "C++" how to synchronize the "C" and "C++"
conversion information? conversion information?
</p></li><li><p> </p></li><li class="listitem"><p>
wchar_t/char internal buffers and conversions between wchar_t/char internal buffers and conversions between
internal/external buffers? internal/external buffers?
</p></li></ul></div></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.codecvt.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id703118"></a><p><span class="title"><i> </p></li></ul></div></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.codecvt.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry" title="The GNU C Library"><a id="id450608"></a><p><span class="title"><i>
The GNU C Library The GNU C Library
</i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id644322"></a><p><span class="title"><i> </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry" title="Correspondence"><a id="id463298"></a><p><span class="title"><i>
Correspondence Correspondence
</i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id644350"></a><p><span class="title"><i> </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry" title="ISO/IEC 14882:1998 Programming languages - C++"><a id="id463327"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++ ISO/IEC 14882:1998 Programming languages - C++
</i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id660838"></a><p><span class="title"><i> </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry" title="ISO/IEC 9899:1999 Programming languages - C"><a id="id476050"></a><p><span class="title"><i>
ISO/IEC 9899:1999 Programming languages - C ISO/IEC 9899:1999 Programming languages - C
</i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id660857"></a><p><span class="title"><i> </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry" title="The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)"><a id="id476068"></a><p><span class="title"><i>
The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004) The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
</i>. </span><span class="copyright">Copyright © 1999 </i>. </span><span class="copyright">Copyright © 1999
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid"> The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid">
<a class="ulink" href="http://www.unix.org/version3/ieee_std.html" target="_top"> <a class="ulink" href="http://www.unix.org/version3/ieee_std.html" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id686728"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="The C++ Programming Language, Special Edition"><a id="id509125"></a><p><span class="title"><i>
The C++ Programming Language, Special Edition The C++ Programming Language, Special Edition
</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername"> </i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley Addison Wesley
. </span></span></p></div><div class="biblioentry"><a id="id720408"></a><p><span class="title"><i> . </span></span></p></div><div class="biblioentry" title="Standard C++ IOStreams and Locales"><a id="id409160"></a><p><span class="title"><i>
Standard C++ IOStreams and Locales Standard C++ IOStreams and Locales
</i>. </span><span class="subtitle"> </i>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference Advanced Programmer's Guide and Reference
. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley Longman, Inc.. </span><span class="publisher"><span class="publishername"> . </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley Longman, Inc.. </span><span class="publisher"><span class="publishername">
Addison Wesley Longman Addison Wesley Longman
. </span></span></p></div><div class="biblioentry"><a id="id692630"></a><p><span class="title"><i> . </span></span></p></div><div class="biblioentry" title="A brief description of Normative Addendum 1"><a id="id521729"></a><p><span class="title"><i>
A brief description of Normative Addendum 1 A brief description of Normative Addendum 1
</i>. </span><span class="author"><span class="firstname">Clive</span> <span class="surname">Feather</span>. </span><span class="pagenums">Extended Character Sets. </span><span class="biblioid"> </i>. </span><span class="author"><span class="firstname">Clive</span> <span class="surname">Feather</span>. </span><span class="pagenums">Extended Character Sets. </span><span class="biblioid">
<a class="ulink" href="http://www.lysator.liu.se/c/na1.html" target="_top"> <a class="ulink" href="http://www.lysator.liu.se/c/na1.html" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id617963"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="The Unicode HOWTO"><a id="id510891"></a><p><span class="title"><i>
The Unicode HOWTO The Unicode HOWTO
</i>. </span><span class="author"><span class="firstname">Bruno</span> <span class="surname">Haible</span>. </span><span class="biblioid"> </i>. </span><span class="author"><span class="firstname">Bruno</span> <span class="surname">Haible</span>. </span><span class="biblioid">
<a class="ulink" href="ftp://ftp.ilog.fr/pub/Users/haible/utf8/Unicode-HOWTO.html" target="_top"> <a class="ulink" href="ftp://ftp.ilog.fr/pub/Users/haible/utf8/Unicode-HOWTO.html" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id681295"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="UTF-8 and Unicode FAQ for Unix/Linux"><a id="id510919"></a><p><span class="title"><i>
UTF-8 and Unicode FAQ for Unix/Linux UTF-8 and Unicode FAQ for Unix/Linux
</i>. </span><span class="author"><span class="firstname">Markus</span> <span class="surname">Khun</span>. </span><span class="biblioid"> </i>. </span><span class="author"><span class="firstname">Markus</span> <span class="surname">Khun</span>. </span><span class="biblioid">
<a class="ulink" href="http://www.cl.cam.ac.uk/~mgk25/unicode.html" target="_top"> <a class="ulink" href="http://www.cl.cam.ac.uk/~mgk25/unicode.html" target="_top">

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 21. Complex</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="numerics.html" title="Part X.  Numerics" /><link rel="prev" href="numerics.html" title="Part X.  Numerics" /><link rel="next" href="generalized_numeric_operations.html" title="Chapter 22. Generalized Operations" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 21. Complex</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="numerics.html">Prev</a> </td><th width="60%" align="center">Part X.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 21. Complex</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="numerics.html" title="Part X.  Numerics" /><link rel="prev" href="numerics.html" title="Part X.  Numerics" /><link rel="next" href="generalized_numeric_operations.html" title="Chapter 22. Generalized Operations" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 21. Complex</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="numerics.html">Prev</a> </td><th width="60%" align="center">Part X. 
Numerics Numerics
</th><td width="20%" align="right"> <a accesskey="n" href="generalized_numeric_operations.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.numerics.complex"></a>Chapter 21. Complex</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="complex.html#numerics.complex.processing">complex Processing</a></span></dt></dl></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="generalized_numeric_operations.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 21. Complex"><div class="titlepage"><div><div><h2 class="title"><a id="manual.numerics.complex"></a>Chapter 21. Complex</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="complex.html#numerics.complex.processing">complex Processing</a></span></dt></dl></div><p>
</p><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="numerics.complex.processing"></a>complex Processing</h2></div></div></div><p> </p><div class="sect1" title="complex Processing"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="numerics.complex.processing"></a>complex Processing</h2></div></div></div><p>
</p><p>Using <code class="code">complex&lt;&gt;</code> becomes even more comple- er, sorry, </p><p>Using <code class="code">complex&lt;&gt;</code> becomes even more comple- er, sorry,
<span class="emphasis"><em>complicated</em></span>, with the not-quite-gratuitously-incompatible <span class="emphasis"><em>complicated</em></span>, with the not-quite-gratuitously-incompatible
addition of complex types to the C language. David Tribble has addition of complex types to the C language. David Tribble has

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Configure</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; configure&#10; , &#10; options&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="setup.html" title="Chapter 2. Setup" /><link rel="prev" href="setup.html" title="Chapter 2. Setup" /><link rel="next" href="make.html" title="Make" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Configure</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="setup.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td width="20%" align="right"> <a accesskey="n" href="make.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.configure"></a>Configure</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Configure</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; configure&#10; , &#10; options&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="setup.html" title="Chapter 2. Setup" /><link rel="prev" href="setup.html" title="Chapter 2. Setup" /><link rel="next" href="make.html" title="Make" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Configure</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="setup.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td width="20%" align="right"> <a accesskey="n" href="make.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Configure"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.configure"></a>Configure</h2></div></div></div><p>
When configuring libstdc++, you'll have to configure the entire When configuring libstdc++, you'll have to configure the entire
<span class="emphasis"><em>gccsrcdir</em></span> directory. Consider using the <span class="emphasis"><em>gccsrcdir</em></span> directory. Consider using the
toplevel gcc configuration option toplevel gcc configuration option

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part VII.  Containers</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="messages.html" title="messages" /><link rel="next" href="sequences.html" title="Chapter 16. Sequences" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part VII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part VII.  Containers</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="messages.html" title="messages" /><link rel="next" href="sequences.html" title="Chapter 16. Sequences" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part VII. 
Containers Containers
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="messages.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="sequences.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.containers"></a>Part VII.  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="messages.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="sequences.html">Next</a></td></tr></table><hr /></div><div class="part" title="Part VII.  Containers"><div class="titlepage"><div><div><h1 class="title"><a id="manual.containers"></a>Part VII. 
Containers Containers
<a id="id644180" class="indexterm"></a> <a id="id432644" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="sequences.html">16. Sequences</a></span></dt><dd><dl><dt><span class="sect1"><a href="sequences.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="sect2"><a href="sequences.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="sect1"><a href="vector.html">vector</a></span></dt><dd><dl><dt><span class="sect2"><a href="vector.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="associative.html">17. Associative</a></span></dt><dd><dl><dt><span class="sect1"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="sect1"><a href="bitset.html">bitset</a></span></dt><dd><dl><dt><span class="sect2"><a href="bitset.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="sect2"><a href="bitset.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="containers_and_c.html">18. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="messages.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sequences.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">messages </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 16. Sequences</td></tr></table></div></body></html> </h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="sequences.html">16. Sequences</a></span></dt><dd><dl><dt><span class="sect1"><a href="sequences.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="sect2"><a href="sequences.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="sect1"><a href="vector.html">vector</a></span></dt><dd><dl><dt><span class="sect2"><a href="vector.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="associative.html">17. Associative</a></span></dt><dd><dl><dt><span class="sect1"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="sect1"><a href="bitset.html">bitset</a></span></dt><dd><dl><dt><span class="sect2"><a href="bitset.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="sect2"><a href="bitset.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="containers_and_c.html">18. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="messages.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sequences.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">messages </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 16. Sequences</td></tr></table></div></body></html>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 18. Interacting with C</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="containers.html" title="Part VII.  Containers" /><link rel="prev" href="bitset.html" title="bitset" /><link rel="next" href="iterators.html" title="Part VIII.  Iterators" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 18. Interacting with C</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bitset.html">Prev</a> </td><th width="60%" align="center">Part VII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 18. Interacting with C</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="containers.html" title="Part VII.  Containers" /><link rel="prev" href="bitset.html" title="bitset" /><link rel="next" href="iterators.html" title="Part VIII.  Iterators" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 18. Interacting with C</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bitset.html">Prev</a> </td><th width="60%" align="center">Part VII. 
Containers Containers
</th><td width="20%" align="right"> <a accesskey="n" href="iterators.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.containers.c"></a>Chapter 18. Interacting with C</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="containers.c.vs_array"></a>Containers vs. Arrays</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="iterators.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 18. Interacting with C"><div class="titlepage"><div><div><h2 class="title"><a id="manual.containers.c"></a>Chapter 18. Interacting with C</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></div><div class="sect1" title="Containers vs. Arrays"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="containers.c.vs_array"></a>Containers vs. Arrays</h2></div></div></div><p>
You're writing some code and can't decide whether to use builtin You're writing some code and can't decide whether to use builtin
arrays or some kind of container. There are compelling reasons arrays or some kind of container. There are compelling reasons
to use one of the container classes, but you're afraid that to use one of the container classes, but you're afraid that
@ -13,7 +13,7 @@
</p><p> </p><p>
If your code makes use of the standard algorithms, this isn't as If your code makes use of the standard algorithms, this isn't as
scary as it sounds. The algorithms don't know, nor care, about scary as it sounds. The algorithms don't know, nor care, about
the kind of “<span class="quote">container</span>” on which they work, since the kind of <span class="quote"><span class="quote">container</span></span> on which they work, since
the algorithms are only given endpoints to work with. For the the algorithms are only given endpoints to work with. For the
container classes, these are iterators (usually container classes, these are iterators (usually
<code class="code">begin()</code> and <code class="code">end()</code>, but not always). <code class="code">begin()</code> and <code class="code">end()</code>, but not always).

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Debugging Support</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; debug&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_exceptions.html" title="Exceptions" /><link rel="next" href="support.html" title="Part II.  Support" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Debugging Support</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_exceptions.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="support.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.debug"></a>Debugging Support</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Debugging Support</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; debug&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="using.html" title="Chapter 3. Using" /><link rel="prev" href="using_exceptions.html" title="Exceptions" /><link rel="next" href="support.html" title="Part II.  Support" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Debugging Support</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using_exceptions.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using</th><td width="20%" align="right"> <a accesskey="n" href="support.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Debugging Support"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.using.debug"></a>Debugging Support</h2></div></div></div><p>
There are numerous things that can be done to improve the ease with There are numerous things that can be done to improve the ease with
which C++ binaries are debugged when using the GNU tool chain. Here which C++ binaries are debugged when using the GNU tool chain. Here
are some of them. are some of them.
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug.compiler"></a>Using <span class="command"><strong>g++</strong></span></h3></div></div></div><p> </p><div class="sect2" title="Using g++"><div class="titlepage"><div><div><h3 class="title"><a id="debug.compiler"></a>Using <span class="command"><strong>g++</strong></span></h3></div></div></div><p>
Compiler flags determine how debug information is transmitted Compiler flags determine how debug information is transmitted
between compilation and debug or analysis tools. between compilation and debug or analysis tools.
</p><p> </p><p>
@ -31,7 +31,7 @@
Many other options are available: please see <a class="ulink" href="http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#Debugging%20Options" target="_top">"Options Many other options are available: please see <a class="ulink" href="http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#Debugging%20Options" target="_top">"Options
for Debugging Your Program"</a> in Using the GNU Compiler for Debugging Your Program"</a> in Using the GNU Compiler
Collection (GCC) for a complete list. Collection (GCC) for a complete list.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug.req"></a>Debug Versions of Library Binary Files</h3></div></div></div><p> </p></div><div class="sect2" title="Debug Versions of Library Binary Files"><div class="titlepage"><div><div><h3 class="title"><a id="debug.req"></a>Debug Versions of Library Binary Files</h3></div></div></div><p>
If you would like debug symbols in libstdc++, there are two ways to If you would like debug symbols in libstdc++, there are two ways to
build libstdc++ with debug flags. The first is to run make from the build libstdc++ with debug flags. The first is to run make from the
toplevel in a freshly-configured tree with toplevel in a freshly-configured tree with
@ -52,7 +52,7 @@
</pre><p> </pre><p>
This quick and dirty approach is often sufficient for quick This quick and dirty approach is often sufficient for quick
debugging tasks, when you cannot or don't want to recompile your debugging tasks, when you cannot or don't want to recompile your
application to use the <a class="link" href="debug_mode.html" title="Chapter 30. Debug Mode">debug mode</a>.</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug.memory"></a>Memory Leak Hunting</h3></div></div></div><p> application to use the <a class="link" href="debug_mode.html" title="Chapter 30. Debug Mode">debug mode</a>.</p></div><div class="sect2" title="Memory Leak Hunting"><div class="titlepage"><div><div><h3 class="title"><a id="debug.memory"></a>Memory Leak Hunting</h3></div></div></div><p>
There are various third party memory tracing and debug utilities There are various third party memory tracing and debug utilities
that can be used to provide detailed memory allocation information that can be used to provide detailed memory allocation information
about C++ code. An exhaustive list of tools is not going to be about C++ code. An exhaustive list of tools is not going to be
@ -121,7 +121,7 @@
up the runtime environment, library, and test file, might be: up the runtime environment, library, and test file, might be:
</p><pre class="programlisting"> </p><pre class="programlisting">
valgrind -v --num-callers=20 --leak-check=yes --leak-resolution=high --show-reachable=yes a.out valgrind -v --num-callers=20 --leak-check=yes --leak-resolution=high --show-reachable=yes a.out
</pre></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug.gdb"></a>Using <span class="command"><strong>gdb</strong></span></h3></div></div></div><p> </pre></div><div class="sect2" title="Using gdb"><div class="titlepage"><div><div><h3 class="title"><a id="debug.gdb"></a>Using <span class="command"><strong>gdb</strong></span></h3></div></div></div><p>
</p><p> </p><p>
Many options are available for gdb itself: please see <a class="ulink" href="http://sources.redhat.com/gdb/current/onlinedocs/gdb_13.html#SEC125" target="_top"> Many options are available for gdb itself: please see <a class="ulink" href="http://sources.redhat.com/gdb/current/onlinedocs/gdb_13.html#SEC125" target="_top">
"GDB features for C++" </a> in the gdb documentation. Also "GDB features for C++" </a> in the gdb documentation. Also
@ -174,16 +174,16 @@
on-line versions of the GDB user manual in GDB's homepage, at on-line versions of the GDB user manual in GDB's homepage, at
<a class="ulink" href="http://sourceware.org/gdb/" target="_top"> "GDB: The GNU Project <a class="ulink" href="http://sourceware.org/gdb/" target="_top"> "GDB: The GNU Project
Debugger" </a>. Debugger" </a>.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug.exceptions"></a>Tracking uncaught exceptions</h3></div></div></div><p> </p></div><div class="sect2" title="Tracking uncaught exceptions"><div class="titlepage"><div><div><h3 class="title"><a id="debug.exceptions"></a>Tracking uncaught exceptions</h3></div></div></div><p>
The <a class="link" href="verbose_termination.html" title="Verbose Terminate Handler">verbose The <a class="link" href="verbose_termination.html" title="Verbose Terminate Handler">verbose
termination handler</a> gives information about uncaught termination handler</a> gives information about uncaught
exceptions which are killing the program. It is described in the exceptions which are killing the program. It is described in the
linked-to page. linked-to page.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug.debug_mode"></a>Debug Mode</h3></div></div></div><p> The <a class="link" href="debug_mode.html" title="Chapter 30. Debug Mode">Debug Mode</a> </p></div><div class="sect2" title="Debug Mode"><div class="titlepage"><div><div><h3 class="title"><a id="debug.debug_mode"></a>Debug Mode</h3></div></div></div><p> The <a class="link" href="debug_mode.html" title="Chapter 30. Debug Mode">Debug Mode</a>
has compile and run-time checks for many containers. has compile and run-time checks for many containers.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug.compile_time_checks"></a>Compile Time Checking</h3></div></div></div><p> The <a class="link" href="ext_compile_checks.html" title="Chapter 29. Compile Time Checks">Compile-Time </p></div><div class="sect2" title="Compile Time Checking"><div class="titlepage"><div><div><h3 class="title"><a id="debug.compile_time_checks"></a>Compile Time Checking</h3></div></div></div><p> The <a class="link" href="ext_compile_checks.html" title="Chapter 29. Compile Time Checks">Compile-Time
Checks</a> Extension has compile-time checks for many algorithms. Checks</a> Extension has compile-time checks for many algorithms.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug.profile_mode"></a>Profile-based Performance Analysis</h3></div></div></div><p> The <a class="link" href="profile_mode.html" title="Chapter 32. Profile Mode">Profile-based </p></div><div class="sect2" title="Profile-based Performance Analysis"><div class="titlepage"><div><div><h3 class="title"><a id="debug.profile_mode"></a>Profile-based Performance Analysis</h3></div></div></div><p> The <a class="link" href="profile_mode.html" title="Chapter 32. Profile Mode">Profile-based
Performance Analysis</a> Extension has performance checks for many Performance Analysis</a> Extension has performance checks for many
algorithms. algorithms.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="using_exceptions.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="using.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="support.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Exceptions </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Part II.  </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="using_exceptions.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="using.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="support.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Exceptions </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Part II. 

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 30. Debug Mode</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; debug&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_compile_checks.html" title="Chapter 29. Compile Time Checks" /><link rel="next" href="bk01pt12ch30s02.html" title="Semantics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 30. Debug Mode</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_compile_checks.html">Prev</a> </td><th width="60%" align="center">Part XII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 30. Debug Mode</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; debug&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_compile_checks.html" title="Chapter 29. Compile Time Checks" /><link rel="next" href="bk01pt12ch30s02.html" title="Semantics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 30. Debug Mode</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_compile_checks.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch30s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.debug_mode"></a>Chapter 30. Debug Mode</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch30s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch30s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch30s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch30s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.methods">Methods</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.debug_mode.intro"></a>Intro</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch30s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 30. Debug Mode"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.debug_mode"></a>Chapter 30. Debug Mode</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch30s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch30s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch30s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch30s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.goals">Goals</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.methods">Methods</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s04.html#debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></div><div class="sect1" title="Intro"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.debug_mode.intro"></a>Intro</h2></div></div></div><p>
By default, libstdc++ is built with efficiency in mind, and By default, libstdc++ is built with efficiency in mind, and
therefore performs little or no error checking that is not therefore performs little or no error checking that is not
required by the C++ standard. This means that programs that required by the C++ standard. This means that programs that
@ -20,11 +20,11 @@
The libstdc++ debug mode performs checking for many areas of the The libstdc++ debug mode performs checking for many areas of the
C++ standard, but the focus is on checking interactions among C++ standard, but the focus is on checking interactions among
standard iterators, containers, and algorithms, including: standard iterators, containers, and algorithms, including:
</p><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Safe iterators</em></span>: Iterators keep track of the </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><span class="emphasis"><em>Safe iterators</em></span>: Iterators keep track of the
container whose elements they reference, so errors such as container whose elements they reference, so errors such as
incrementing a past-the-end iterator or dereferencing an iterator incrementing a past-the-end iterator or dereferencing an iterator
that points to a container that has been destructed are diagnosed that points to a container that has been destructed are diagnosed
immediately.</p></li><li><p><span class="emphasis"><em>Algorithm preconditions</em></span>: Algorithms attempt to immediately.</p></li><li class="listitem"><p><span class="emphasis"><em>Algorithm preconditions</em></span>: Algorithms attempt to
validate their input parameters to detect errors as early as validate their input parameters to detect errors as early as
possible. For instance, the <code class="code">set_intersection</code> possible. For instance, the <code class="code">set_intersection</code>
algorithm requires that its iterator algorithm requires that its iterator

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part III.  Diagnostics</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="verbose_termination.html" title="Verbose Terminate Handler" /><link rel="next" href="exceptions.html" title="Chapter 7. Exceptions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part III.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part III.  Diagnostics</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="verbose_termination.html" title="Verbose Terminate Handler" /><link rel="next" href="exceptions.html" title="Chapter 7. Exceptions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part III. 
Diagnostics Diagnostics
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="verbose_termination.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="exceptions.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.diagnostics"></a>Part III.  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="verbose_termination.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="exceptions.html">Next</a></td></tr></table><hr /></div><div class="part" title="Part III.  Diagnostics"><div class="titlepage"><div><div><h1 class="title"><a id="manual.diagnostics"></a>Part III. 
Diagnostics Diagnostics
<a id="id702920" class="indexterm"></a> <a id="id481780" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="exceptions.html">7. Exceptions</a></span></dt><dd><dl><dt><span class="sect1"><a href="exceptions.html#manual.diagnostics.exceptions.hierarchy">Exception Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s02.html">Adding Data to Exceptions</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt03ch08.html">8. Concept Checking</a></span></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="verbose_termination.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="exceptions.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Verbose Terminate Handler </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 7. Exceptions</td></tr></table></div></body></html> </h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="exceptions.html">7. Exceptions</a></span></dt><dd><dl><dt><span class="sect1"><a href="exceptions.html#manual.diagnostics.exceptions.hierarchy">Exception Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s02.html">Adding Data to Exceptions</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt03ch08.html">8. Concept Checking</a></span></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="verbose_termination.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="exceptions.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Verbose Terminate Handler </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 7. Exceptions</td></tr></table></div></body></html>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Documentation Style</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="appendix_contributing.html" title="Appendix A.  Contributing" /><link rel="prev" href="source_code_style.html" title="Coding Style" /><link rel="next" href="source_design_notes.html" title="Design Notes" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Documentation Style</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="source_code_style.html">Prev</a> </td><th width="60%" align="center">Appendix A.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Documentation Style</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="appendix_contributing.html" title="Appendix A.  Contributing" /><link rel="prev" href="source_code_style.html" title="Coding Style" /><link rel="next" href="source_design_notes.html" title="Design Notes" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Documentation Style</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="source_code_style.html">Prev</a> </td><th width="60%" align="center">Appendix A. 
Contributing Contributing
</th><td width="20%" align="right"> <a accesskey="n" href="source_design_notes.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="contrib.doc_style"></a>Documentation Style</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="doc_style.doxygen"></a>Doxygen</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.prereq"></a>Prerequisites</h4></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="source_design_notes.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Documentation Style"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="contrib.doc_style"></a>Documentation Style</h2></div></div></div><div class="sect2" title="Doxygen"><div class="titlepage"><div><div><h3 class="title"><a id="doc_style.doxygen"></a>Doxygen</h3></div></div></div><div class="sect3" title="Prerequisites"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.prereq"></a>Prerequisites</h4></div></div></div><p>
Prerequisite tools are Bash 2.x, Prerequisite tools are Bash 2.x,
<a class="ulink" href="http://www.doxygen.org/" target="_top">Doxygen</a>, and <a class="ulink" href="http://www.doxygen.org/" target="_top">Doxygen</a>, and
the <a class="ulink" href="http://www.gnu.org/software/coreutils/" target="_top">GNU the <a class="ulink" href="http://www.gnu.org/software/coreutils/" target="_top">GNU
@ -15,7 +15,7 @@
graphs, the graphs, the
<a class="ulink" href="http://www.graphviz.org" target="_top">Graphviz</a> <a class="ulink" href="http://www.graphviz.org" target="_top">Graphviz</a>
package will need to be installed. package will need to be installed.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.rules"></a>Generating the Doxygen Files</h4></div></div></div><p> </p></div><div class="sect3" title="Generating the Doxygen Files"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.rules"></a>Generating the Doxygen Files</h4></div></div></div><p>
The following Makefile rules run Doxygen to generate HTML The following Makefile rules run Doxygen to generate HTML
docs, XML docs, and the man pages. docs, XML docs, and the man pages.
</p><p> </p><p>
@ -35,7 +35,7 @@
If you wish to tweak the Doxygen settings, do so by editing If you wish to tweak the Doxygen settings, do so by editing
<code class="filename">doc/doxygen/user.cfg.in</code>. Notes to fellow <code class="filename">doc/doxygen/user.cfg.in</code>. Notes to fellow
library hackers are written in triple-# comments. library hackers are written in triple-# comments.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.markup"></a>Markup</h4></div></div></div><p> </p></div><div class="sect3" title="Markup"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.markup"></a>Markup</h4></div></div></div><p>
In general, libstdc++ files should be formatted according to In general, libstdc++ files should be formatted according to
the rules found in the the rules found in the
<a class="link" href="source_code_style.html" title="Coding Style">Coding Standard</a>. Before <a class="link" href="source_code_style.html" title="Coding Style">Coding Standard</a>. Before
@ -43,7 +43,7 @@
make sure that the initial formatting is sound. make sure that the initial formatting is sound.
</p><p> </p><p>
Adding Doxygen markup to a file (informally called Adding Doxygen markup to a file (informally called
<span class="quote">doxygenating</span>”) is very simple. The Doxygen manual can be <span class="quote"><span class="quote">doxygenating</span></span>) is very simple. The Doxygen manual can be
found found
<a class="ulink" href="http://www.stack.nl/~dimitri/doxygen/download.html#latestman" target="_top">here</a>. <a class="ulink" href="http://www.stack.nl/~dimitri/doxygen/download.html#latestman" target="_top">here</a>.
We try to use a very-recent version of Doxygen. We try to use a very-recent version of Doxygen.
@ -58,14 +58,14 @@
</p><p> </p><p>
These points accompany the first list in section 3.1 of the These points accompany the first list in section 3.1 of the
Doxygen manual: Doxygen manual:
</p><div class="orderedlist"><ol type="1"><li><p>Use the Javadoc style...</p></li><li><p> </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Use the Javadoc style...</p></li><li class="listitem"><p>
...not the Qt style. The intermediate *'s are preferred. ...not the Qt style. The intermediate *'s are preferred.
</p></li><li><p> </p></li><li class="listitem"><p>
Use the triple-slash style only for one-line comments (the Use the triple-slash style only for one-line comments (the
<span class="quote">brief</span>” mode). Very recent versions of Doxygen permit <span class="quote"><span class="quote">brief</span></span> mode). Very recent versions of Doxygen permit
full-mode comments in triple-slash blocks, but the full-mode comments in triple-slash blocks, but the
formatting still comes out wonky. formatting still comes out wonky.
</p></li><li><p> </p></li><li class="listitem"><p>
This is disgusting. Don't do this. This is disgusting. Don't do this.
</p></li></ol></div><p> </p></li></ol></div><p>
Use the @-style of commands, not the !-style. Please be Use the @-style of commands, not the !-style. Please be
@ -73,24 +73,24 @@
time it doesn't matter; doxygen absorbs most whitespace, and time it doesn't matter; doxygen absorbs most whitespace, and
both HTML and *roff are agnostic about whitespace. However, both HTML and *roff are agnostic about whitespace. However,
in &lt;pre&gt; blocks and @code/@endcode sections, spacing can in &lt;pre&gt; blocks and @code/@endcode sections, spacing can
have “<span class="quote">interesting</span>” effects. have <span class="quote"><span class="quote">interesting</span></span> effects.
</p><p> </p><p>
Use either kind of grouping, as Use either kind of grouping, as
appropriate. <code class="filename">doxygroups.cc</code> exists for this appropriate. <code class="filename">doxygroups.cc</code> exists for this
purpose. See <code class="filename">stl_iterator.h</code> for a good example purpose. See <code class="filename">stl_iterator.h</code> for a good example
of the “<span class="quote">other</span>” kind of grouping. of the <span class="quote"><span class="quote">other</span></span> kind of grouping.
</p><p> </p><p>
Please use markup tags like @p and @a when referring to things Please use markup tags like @p and @a when referring to things
such as the names of function parameters. Use @e for emphasis such as the names of function parameters. Use @e for emphasis
when necessary. Use @c to refer to other standard names. when necessary. Use @c to refer to other standard names.
(Examples of all these abound in the present code.) (Examples of all these abound in the present code.)
</p></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="doc_style.docbook"></a>Docbook</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.prereq"></a>Prerequisites</h4></div></div></div><p> </p></div></div><div class="sect2" title="Docbook"><div class="titlepage"><div><div><h3 class="title"><a id="doc_style.docbook"></a>Docbook</h3></div></div></div><div class="sect3" title="Prerequisites"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.prereq"></a>Prerequisites</h4></div></div></div><p>
Editing the DocBook sources requires an XML editor. Many Editing the DocBook sources requires an XML editor. Many
exist: some notable options exist: some notable options
include <span class="command"><strong>emacs</strong></span>, <span class="application">Kate</span>, include <span class="command"><strong>emacs</strong></span>, <span class="application">Kate</span>,
or <span class="application">Conglomerate</span>. or <span class="application">Conglomerate</span>.
</p><p> </p><p>
Some editors support special “<span class="quote">XML Validation</span> Some editors support special <span class="quote"><span class="quote">XML Validation</span></span>
modes that can validate the file as it is modes that can validate the file as it is
produced. Recommended is the <span class="command"><strong>nXML Mode</strong></span> produced. Recommended is the <span class="command"><strong>nXML Mode</strong></span>
for <span class="command"><strong>emacs</strong></span>. for <span class="command"><strong>emacs</strong></span>.
@ -133,7 +133,7 @@
<strong class="userinput"><code> <strong class="userinput"><code>
xmllint --noout --valid <code class="filename">xml/index.xml</code> xmllint --noout --valid <code class="filename">xml/index.xml</code>
</code></strong> </code></strong>
</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.rules"></a>Generating the DocBook Files</h4></div></div></div><p> </pre></div><div class="sect3" title="Generating the DocBook Files"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.rules"></a>Generating the DocBook Files</h4></div></div></div><p>
The following Makefile rules generate (in order): an HTML The following Makefile rules generate (in order): an HTML
version of all the documentation, a PDF version of the same, a version of all the documentation, a PDF version of the same, a
single XML document, and the result of validating the entire XML single XML document, and the result of validating the entire XML
@ -146,7 +146,7 @@ xmllint --noout --valid <code class="filename">xml/index.xml</code>
</p><pre class="screen"><strong class="userinput"><code>make doc-xml-single</code></strong></pre><p> </p><pre class="screen"><strong class="userinput"><code>make doc-xml-single</code></strong></pre><p>
</p><p> </p><p>
</p><pre class="screen"><strong class="userinput"><code>make doc-xml-validate</code></strong></pre><p> </p><pre class="screen"><strong class="userinput"><code>make doc-xml-validate</code></strong></pre><p>
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.examples"></a>File Organization and Basics</h4></div></div></div><div class="literallayout"><p><br /> </p></div><div class="sect3" title="File Organization and Basics"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.examples"></a>File Organization and Basics</h4></div></div></div><div class="literallayout"><p><br />
      <span class="emphasis"><em>Which files are important</em></span><br />       <span class="emphasis"><em>Which files are important</em></span><br />
<br /> <br />
      All Docbook files are in the directory<br />       All Docbook files are in the directory<br />
@ -206,16 +206,16 @@ xmllint --noout --valid <code class="filename">xml/index.xml</code>
      &lt;/book&gt;<br />       &lt;/book&gt;<br />
<br /> <br />
      &lt;/set&gt;<br />       &lt;/set&gt;<br />
    </p></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.markup"></a>Markup By Example</h4></div></div></div><p>     </p></div></div><div class="sect3" title="Markup By Example"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.markup"></a>Markup By Example</h4></div></div></div><p>
Complete details on Docbook markup can be found in the DocBook Element Complete details on Docbook markup can be found in the DocBook Element
Reference, <a class="ulink" href="http://www.docbook.org/tdg/en/html/part2.html" target="_top">online</a>. An Reference, <a class="ulink" href="http://www.docbook.org/tdg/en/html/part2.html" target="_top">online</a>. An
incomplete reference for HTML to Docbook conversion is detailed in the incomplete reference for HTML to Docbook conversion is detailed in the
table below. table below.
</p><div class="table"><a id="id740402"></a><p class="title"><b>Table A.1. HTML to Docbook XML markup comparison</b></p><div class="table-contents"><table summary="HTML to Docbook XML markup comparison" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">HTML</th><th align="left">XML</th></tr></thead><tbody><tr><td align="left">&lt;p&gt;</td><td align="left">&lt;para&gt;</td></tr><tr><td align="left">&lt;pre&gt;</td><td align="left">&lt;computeroutput&gt;, &lt;programlisting&gt;, </p><div class="table"><a id="id414841"></a><p class="title"><b>Table A.1. HTML to Docbook XML markup comparison</b></p><div class="table-contents"><table summary="HTML to Docbook XML markup comparison" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">HTML</th><th align="left">XML</th></tr></thead><tbody><tr><td align="left">&lt;p&gt;</td><td align="left">&lt;para&gt;</td></tr><tr><td align="left">&lt;pre&gt;</td><td align="left">&lt;computeroutput&gt;, &lt;programlisting&gt;,
&lt;literallayout&gt;</td></tr><tr><td align="left">&lt;ul&gt;</td><td align="left">&lt;itemizedlist&gt;</td></tr><tr><td align="left">&lt;ol&gt;</td><td align="left">&lt;orderedlist&gt;</td></tr><tr><td align="left">&lt;il&gt;</td><td align="left">&lt;listitem&gt;</td></tr><tr><td align="left">&lt;dl&gt;</td><td align="left">&lt;variablelist&gt;</td></tr><tr><td align="left">&lt;dt&gt;</td><td align="left">&lt;term&gt;</td></tr><tr><td align="left">&lt;dd&gt;</td><td align="left">&lt;listitem&gt;</td></tr><tr><td align="left">&lt;a href=""&gt;</td><td align="left">&lt;ulink url=""&gt;</td></tr><tr><td align="left">&lt;code&gt;</td><td align="left">&lt;literal&gt;, &lt;programlisting&gt;</td></tr><tr><td align="left">&lt;strong&gt;</td><td align="left">&lt;emphasis&gt;</td></tr><tr><td align="left">&lt;em&gt;</td><td align="left">&lt;emphasis&gt;</td></tr><tr><td align="left">"</td><td align="left">&lt;quote&gt;</td></tr></tbody></table></div></div><br class="table-break" /><p> &lt;literallayout&gt;</td></tr><tr><td align="left">&lt;ul&gt;</td><td align="left">&lt;itemizedlist&gt;</td></tr><tr><td align="left">&lt;ol&gt;</td><td align="left">&lt;orderedlist&gt;</td></tr><tr><td align="left">&lt;il&gt;</td><td align="left">&lt;listitem&gt;</td></tr><tr><td align="left">&lt;dl&gt;</td><td align="left">&lt;variablelist&gt;</td></tr><tr><td align="left">&lt;dt&gt;</td><td align="left">&lt;term&gt;</td></tr><tr><td align="left">&lt;dd&gt;</td><td align="left">&lt;listitem&gt;</td></tr><tr><td align="left">&lt;a href=""&gt;</td><td align="left">&lt;ulink url=""&gt;</td></tr><tr><td align="left">&lt;code&gt;</td><td align="left">&lt;literal&gt;, &lt;programlisting&gt;</td></tr><tr><td align="left">&lt;strong&gt;</td><td align="left">&lt;emphasis&gt;</td></tr><tr><td align="left">&lt;em&gt;</td><td align="left">&lt;emphasis&gt;</td></tr><tr><td align="left">"</td><td align="left">&lt;quote&gt;</td></tr></tbody></table></div></div><br class="table-break" /><p>
And examples of detailed markup for which there are no real HTML And examples of detailed markup for which there are no real HTML
equivalents are listed in the table below. equivalents are listed in the table below.
</p><div class="table"><a id="id613462"></a><p class="title"><b>Table A.2. Docbook XML Element Use</b></p><div class="table-contents"><table summary="Docbook XML Element Use" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Element</th><th align="left">Use</th></tr></thead><tbody><tr><td align="left">&lt;structname&gt;</td><td align="left">&lt;structname&gt;char_traits&lt;/structname&gt;</td></tr><tr><td align="left">&lt;classname&gt;</td><td align="left">&lt;classname&gt;string&lt;/classname&gt;</td></tr><tr><td align="left">&lt;function&gt;</td><td align="left"> </p><div class="table"><a id="id516730"></a><p class="title"><b>Table A.2. Docbook XML Element Use</b></p><div class="table-contents"><table summary="Docbook XML Element Use" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Element</th><th align="left">Use</th></tr></thead><tbody><tr><td align="left">&lt;structname&gt;</td><td align="left">&lt;structname&gt;char_traits&lt;/structname&gt;</td></tr><tr><td align="left">&lt;classname&gt;</td><td align="left">&lt;classname&gt;string&lt;/classname&gt;</td></tr><tr><td align="left">&lt;function&gt;</td><td align="left">
<p>&lt;function&gt;clear()&lt;/function&gt;</p> <p>&lt;function&gt;clear()&lt;/function&gt;</p>
<p>&lt;function&gt;fs.clear()&lt;/function&gt;</p> <p>&lt;function&gt;fs.clear()&lt;/function&gt;</p>
</td></tr><tr><td align="left">&lt;type&gt;</td><td align="left">&lt;type&gt;long long&lt;/type&gt;</td></tr><tr><td align="left">&lt;varname&gt;</td><td align="left">&lt;varname&gt;fs&lt;/varname&gt;</td></tr><tr><td align="left">&lt;literal&gt;</td><td align="left"> </td></tr><tr><td align="left">&lt;type&gt;</td><td align="left">&lt;type&gt;long long&lt;/type&gt;</td></tr><tr><td align="left">&lt;varname&gt;</td><td align="left">&lt;varname&gt;fs&lt;/varname&gt;</td></tr><tr><td align="left">&lt;literal&gt;</td><td align="left">

View File

@ -1,28 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 5. Dynamic Memory</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="support.html" title="Part II.  Support" /><link rel="prev" href="bk01pt02ch04s03.html" title="NULL" /><link rel="next" href="termination.html" title="Chapter 6. Termination" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. Dynamic Memory</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt02ch04s03.html">Prev</a> </td><th width="60%" align="center">Part II.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 5. Dynamic Memory</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="support.html" title="Part II.  Support" /><link rel="prev" href="bk01pt02ch04s03.html" title="NULL" /><link rel="next" href="termination.html" title="Chapter 6. Termination" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. Dynamic Memory</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt02ch04s03.html">Prev</a> </td><th width="60%" align="center">Part II. 
Support Support
</th><td width="20%" align="right"> <a accesskey="n" href="termination.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.support.memory"></a>Chapter 5. Dynamic Memory</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="termination.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 5. Dynamic Memory"><div class="titlepage"><div><div><h2 class="title"><a id="manual.support.memory"></a>Chapter 5. Dynamic Memory</h2></div></div></div><p>
There are six flavors each of <code class="function">new</code> and There are six flavors each of <code class="function">new</code> and
<code class="function">delete</code>, so make certain that you're using the right <code class="function">delete</code>, so make certain that you're using the right
ones. Here are quickie descriptions of <code class="function">new</code>: ones. Here are quickie descriptions of <code class="function">new</code>:
</p><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
single object form, throwing a single object form, throwing a
<code class="classname">bad_alloc</code> on errors; this is what most <code class="classname">bad_alloc</code> on errors; this is what most
people are used to using people are used to using
</p></li><li><p> </p></li><li class="listitem"><p>
Single object "nothrow" form, returning NULL on errors Single object "nothrow" form, returning NULL on errors
</p></li><li><p> </p></li><li class="listitem"><p>
Array <code class="function">new</code>, throwing Array <code class="function">new</code>, throwing
<code class="classname">bad_alloc</code> on errors <code class="classname">bad_alloc</code> on errors
</p></li><li><p> </p></li><li class="listitem"><p>
Array nothrow <code class="function">new</code>, returning Array nothrow <code class="function">new</code>, returning
<code class="constant">NULL</code> on errors <code class="constant">NULL</code> on errors
</p></li><li><p> </p></li><li class="listitem"><p>
Placement <code class="function">new</code>, which does nothing (like Placement <code class="function">new</code>, which does nothing (like
it's supposed to) it's supposed to)
</p></li><li><p> </p></li><li class="listitem"><p>
Placement array <code class="function">new</code>, which also does Placement array <code class="function">new</code>, which also does
nothing nothing
</p></li></ul></div><p> </p></li></ul></div><p>
@ -36,7 +36,7 @@
NULL pointer! Nothing happens, by definition. That is not the NULL pointer! Nothing happens, by definition. That is not the
same thing as deleting a pointer twice. same thing as deleting a pointer twice.
</p><p> </p><p>
By default, if one of the “<span class="quote">throwing <code class="function">new</code>s</span>” can't By default, if one of the <span class="quote"><span class="quote">throwing <code class="function">new</code>s</span></span> can't
allocate the memory requested, it tosses an instance of a allocate the memory requested, it tosses an instance of a
<code class="classname">bad_alloc</code> exception (or, technically, some class derived <code class="classname">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

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 7. Exceptions</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="diagnostics.html" title="Part III.  Diagnostics" /><link rel="prev" href="diagnostics.html" title="Part III.  Diagnostics" /><link rel="next" href="bk01pt03ch07s02.html" title="Adding Data to Exceptions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 7. Exceptions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="diagnostics.html">Prev</a> </td><th width="60%" align="center">Part III.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 7. Exceptions</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="diagnostics.html" title="Part III.  Diagnostics" /><link rel="prev" href="diagnostics.html" title="Part III.  Diagnostics" /><link rel="next" href="bk01pt03ch07s02.html" title="Adding Data to Exceptions" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 7. Exceptions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="diagnostics.html">Prev</a> </td><th width="60%" align="center">Part III. 
Diagnostics Diagnostics
</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt03ch07s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.diagnostics.exceptions"></a>Chapter 7. Exceptions</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="exceptions.html#manual.diagnostics.exceptions.hierarchy">Exception Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s02.html">Adding Data to Exceptions</a></span></dt></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.diagnostics.exceptions.hierarchy"></a>Exception Classes</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="bk01pt03ch07s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 7. Exceptions"><div class="titlepage"><div><div><h2 class="title"><a id="manual.diagnostics.exceptions"></a>Chapter 7. Exceptions</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="exceptions.html#manual.diagnostics.exceptions.hierarchy">Exception Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s02.html">Adding Data to Exceptions</a></span></dt></dl></div><div class="sect1" title="Exception Classes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.diagnostics.exceptions.hierarchy"></a>Exception Classes</h2></div></div></div><p>
All exception objects are defined in one of the standard header All exception objects are defined in one of the standard header
files: <code class="filename">exception</code>, files: <code class="filename">exception</code>,
<code class="filename">stdexcept</code>, <code class="filename">new</code>, and <code class="filename">stdexcept</code>, <code class="filename">new</code>, and

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 36. Algorithms</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_utilities.html" title="Chapter 35. Utilities" /><link rel="next" href="ext_numerics.html" title="Chapter 37. Numerics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 36. Algorithms</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_utilities.html">Prev</a> </td><th width="60%" align="center">Part XII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 36. Algorithms</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_utilities.html" title="Chapter 35. Utilities" /><link rel="next" href="ext_numerics.html" title="Chapter 37. Numerics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 36. Algorithms</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_utilities.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_numerics.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.algorithms"></a>Chapter 36. Algorithms</h2></div></div></div><p>25.1.6 (count, count_if) is extended with two more versions of count </th><td width="20%" align="right"> <a accesskey="n" href="ext_numerics.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 36. Algorithms"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.algorithms"></a>Chapter 36. Algorithms</h2></div></div></div><p>25.1.6 (count, count_if) is extended with two more versions of count
and count_if. The standard versions return their results. The and count_if. The standard versions return their results. The
additional signatures return void, but take a final parameter by additional signatures return void, but take a final parameter by
reference to which they assign their results, e.g., reference to which they assign their results, e.g.,
@ -15,7 +15,7 @@
copy_n (_InputIter first, _Size count, _OutputIter result);</pre><p>which copies the first 'count' elements at 'first' into 'result'. copy_n (_InputIter first, _Size count, _OutputIter result);</pre><p>which copies the first 'count' elements at 'first' into 'result'.
</p><p>25.3 (sorting 'n' heaps 'n' stuff) is extended with some helper </p><p>25.3 (sorting 'n' heaps 'n' stuff) is extended with some helper
predicates. Look in the doxygen-generated pages for notes on these. predicates. Look in the doxygen-generated pages for notes on these.
</p><div class="itemizedlist"><ul type="disc"><li><p><code class="code">is_heap</code> tests whether or not a range is a heap.</p></li><li><p><code class="code">is_sorted</code> tests whether or not a range is sorted in </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><code class="code">is_heap</code> tests whether or not a range is a heap.</p></li><li class="listitem"><p><code class="code">is_sorted</code> tests whether or not a range is sorted in
nondescending order.</p></li></ul></div><p>25.3.8 (lexicographical_compare) is extended with nondescending order.</p></li></ul></div><p>25.3.8 (lexicographical_compare) is extended with
</p><pre class="programlisting"> </p><pre class="programlisting">
lexicographical_compare_3way(_InputIter1 first1, _InputIter1 last1, lexicographical_compare_3way(_InputIter1 first1, _InputIter1 last1,

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 33. Allocators</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bk01pt12ch32s07.html" title="Diagnostics" /><link rel="next" href="bitmap_allocator.html" title="bitmap_allocator" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 33. Allocators</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s07.html">Prev</a> </td><th width="60%" align="center">Part XII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 33. Allocators</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bk01pt12ch32s07.html" title="Diagnostics" /><link rel="next" href="bitmap_allocator.html" title="bitmap_allocator" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 33. Allocators</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch32s07.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="bitmap_allocator.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator"></a>Chapter 33. Allocators</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ext_allocators.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.allocator.mt"></a>mt_allocator</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="bitmap_allocator.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 33. Allocators"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.allocator"></a>Chapter 33. Allocators</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ext_allocators.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="sect2"><a href="ext_allocators.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></div><div class="sect1" title="mt_allocator"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.allocator.mt"></a>mt_allocator</h2></div></div></div><p>
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.intro"></a>Intro</h3></div></div></div><p> </p><div class="sect2" title="Intro"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.intro"></a>Intro</h3></div></div></div><p>
The mt allocator [hereinafter referred to simply as "the allocator"] The mt allocator [hereinafter referred to simply as "the allocator"]
is a fixed size (power of two) allocator that was initially is a fixed size (power of two) allocator that was initially
developed specifically to suit the needs of multi threaded developed specifically to suit the needs of multi threaded
@ -20,7 +20,7 @@
</p><p> </p><p>
The aim of this document is to describe - from an application point of The aim of this document is to describe - from an application point of
view - the "inner workings" of the allocator. view - the "inner workings" of the allocator.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.design_issues"></a>Design Issues</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.mt.overview"></a>Overview</h4></div></div></div><p> There are three general components to the allocator: a datum </p></div><div class="sect2" title="Design Issues"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.design_issues"></a>Design Issues</h3></div></div></div><div class="sect3" title="Overview"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.mt.overview"></a>Overview</h4></div></div></div><p> There are three general components to the allocator: a datum
describing the characteristics of the memory pool, a policy class describing the characteristics of the memory pool, a policy class
containing this pool that links instantiation types to common or containing this pool that links instantiation types to common or
individual pools, and a class inheriting from the policy class that is individual pools, and a class inheriting from the policy class that is
@ -56,10 +56,10 @@ tuning, for instance.
</pre><p> This class has the interface required for standard library allocator </pre><p> This class has the interface required for standard library allocator
classes, namely member functions <code class="code">allocate</code> and classes, namely member functions <code class="code">allocate</code> and
<code class="code">deallocate</code>, plus others. <code class="code">deallocate</code>, plus others.
</p></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.mt.tune"></a>Tunable Parameters</h4></div></div></div><p>Certain allocation parameters can be modified, or tuned. There </p></div></div><div class="sect2" title="Implementation"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.impl"></a>Implementation</h3></div></div></div><div class="sect3" title="Tunable Parameters"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.mt.tune"></a>Tunable Parameters</h4></div></div></div><p>Certain allocation parameters can be modified, or tuned. There
exists a nested <code class="code">struct __pool_base::_Tune</code> that contains all exists a nested <code class="code">struct __pool_base::_Tune</code> that contains all
these parameters, which include settings for these parameters, which include settings for
</p><div class="itemizedlist"><ul type="disc"><li><p>Alignment</p></li><li><p>Maximum bytes before calling <code class="code">::operator new</code> directly</p></li><li><p>Minimum bytes</p></li><li><p>Size of underlying global allocations</p></li><li><p>Maximum number of supported threads</p></li><li><p>Migration of deallocations to the global free list</p></li><li><p>Shunt for global <code class="code">new</code> and <code class="code">delete</code></p></li></ul></div><p>Adjusting parameters for a given instance of an allocator can only </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Alignment</p></li><li class="listitem"><p>Maximum bytes before calling <code class="code">::operator new</code> directly</p></li><li class="listitem"><p>Minimum bytes</p></li><li class="listitem"><p>Size of underlying global allocations</p></li><li class="listitem"><p>Maximum number of supported threads</p></li><li class="listitem"><p>Migration of deallocations to the global free list</p></li><li class="listitem"><p>Shunt for global <code class="code">new</code> and <code class="code">delete</code></p></li></ul></div><p>Adjusting parameters for a given instance of an allocator can only
happen before any allocations take place, when the allocator itself is happen before any allocations take place, when the allocator itself is
initialized. For instance: initialized. For instance:
</p><pre class="programlisting"> </p><pre class="programlisting">
@ -95,7 +95,7 @@ int main()
return 0; return 0;
} }
</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.mt.init"></a>Initialization</h4></div></div></div><p> </pre></div><div class="sect3" title="Initialization"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.mt.init"></a>Initialization</h4></div></div></div><p>
The static variables (pointers to freelists, tuning parameters etc) The static variables (pointers to freelists, tuning parameters etc)
are initialized as above, or are set to the global defaults. are initialized as above, or are set to the global defaults.
</p><p> </p><p>
@ -187,7 +187,7 @@ The _S_initialize() function:
for this specific bin. This only occurs when a number of blocks for this specific bin. This only occurs when a number of blocks
are grabbed from the global list to a thread specific list or when are grabbed from the global list to a thread specific list or when
a thread decides to return some blocks to the global freelist. a thread decides to return some blocks to the global freelist.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.mt.deallocation"></a>Deallocation Notes</h4></div></div></div><p> Notes about deallocation. This allocator does not explicitly </p></div><div class="sect3" title="Deallocation Notes"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.mt.deallocation"></a>Deallocation Notes</h4></div></div></div><p> Notes about deallocation. This allocator does not explicitly
release memory. Because of this, memory debugging programs like release memory. Because of this, memory debugging programs like
valgrind or purify may notice leaks: sorry about this valgrind or purify may notice leaks: sorry about this
inconvenience. Operating systems will reclaim allocated memory at inconvenience. Operating systems will reclaim allocated memory at
@ -214,7 +214,7 @@ implementation-specific, and subject to change. For an example of a
pool that frees memory, see the following pool that frees memory, see the following
<a class="ulink" href="http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc?view=markup" target="_top"> <a class="ulink" href="http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc?view=markup" target="_top">
example.</a> example.</a>
</p></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.example_single"></a>Single Thread Example</h3></div></div></div><p> </p></div></div><div class="sect2" title="Single Thread Example"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.example_single"></a>Single Thread Example</h3></div></div></div><p>
Let's start by describing how the data on a freelist is laid out in memory. Let's start by describing how the data on a freelist is laid out in memory.
This is the first two blocks in freelist for thread id 3 in bin 3 (8 bytes): This is the first two blocks in freelist for thread id 3 in bin 3 (8 bytes):
</p><pre class="programlisting"> </p><pre class="programlisting">
@ -290,7 +290,7 @@ of the global freelist and update the pointer as needed
The decision to add deallocated blocks to the front of the freelist was made The decision to add deallocated blocks to the front of the freelist was made
after a set of performance measurements that showed that this is roughly 10% after a set of performance measurements that showed that this is roughly 10%
faster than maintaining a set of "last pointers" as well. faster than maintaining a set of "last pointers" as well.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.example_multi"></a>Multiple Thread Example</h3></div></div></div><p> </p></div><div class="sect2" title="Multiple Thread Example"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.mt.example_multi"></a>Multiple Thread Example</h3></div></div></div><p>
In the ST example we never used the thread_id variable present in each block. In the ST example we never used the thread_id variable present in each block.
Let's start by explaining the purpose of this in a MT application. Let's start by explaining the purpose of this in a MT application.
</p><p> </p><p>

View File

@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 29. Compile Time Checks</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bk01pt12pr03.html" title="" /><link rel="next" href="debug_mode.html" title="Chapter 30. Debug Mode" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 29. Compile Time Checks</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12pr03.html">Prev</a> </td><th width="60%" align="center">Part XII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 29. Compile Time Checks</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bk01pt12pr03.html" title="" /><link rel="next" href="debug_mode.html" title="Chapter 30. Debug Mode" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 29. Compile Time Checks</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12pr03.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="debug_mode.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.compile_checks"></a>Chapter 29. Compile Time Checks</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="debug_mode.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 29. Compile Time Checks"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.compile_checks"></a>Chapter 29. Compile Time Checks</h2></div></div></div><p>
Also known as concept checking. Also known as concept checking.
</p><p>In 1999, SGI added <span class="emphasis"><em>concept checkers</em></span> to their implementation </p><p>In 1999, SGI added <span class="emphasis"><em>concept checkers</em></span> to their implementation
of the STL: code which checked the template parameters of of the STL: code which checked the template parameters of
instantiated pieces of the STL, in order to insure that the parameters instantiated pieces of the STL, in order to insure that the parameters
being used met the requirements of the standard. For example, being used met the requirements of the standard. For example,
the Standard requires that types passed as template parameters to the Standard requires that types passed as template parameters to
<code class="code">vector</code> be “<span class="quote">Assignable</span>” (which means what you think <code class="code">vector</code> be <span class="quote"><span class="quote">Assignable</span></span> (which means what you think
it means). The checking was done during compilation, and none of it means). The checking was done during compilation, and none of
the code was executed at runtime. the code was executed at runtime.
</p><p>Unfortunately, the size of the compiler files grew significantly </p><p>Unfortunately, the size of the compiler files grew significantly

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 41. Concurrency</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_demangling.html" title="Chapter 40. Demangling" /><link rel="next" href="bk01pt12ch41s02.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 41. Concurrency</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><th width="60%" align="center">Part XII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 41. Concurrency</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_demangling.html" title="Chapter 40. Demangling" /><link rel="next" href="bk01pt12ch41s02.html" title="Implementation" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 41. Concurrency</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_demangling.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch41s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency"></a>Chapter 41. Concurrency</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch41s02.html">Implementation</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch41s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch41s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch41s03.html">Use</a></span></dt></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.design"></a>Design</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.design.threads"></a>Interface to Locks and Mutexes</h3></div></div></div><p>The file &lt;ext/concurrence.h&gt; contains all the higher-level </th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch41s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 41. Concurrency"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.concurrency"></a>Chapter 41. Concurrency</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ext_concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="sect2"><a href="ext_concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch41s02.html">Implementation</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch41s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch41s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch41s03.html">Use</a></span></dt></dl></div><div class="sect1" title="Design"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.concurrency.design"></a>Design</h2></div></div></div><div class="sect2" title="Interface to Locks and Mutexes"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.design.threads"></a>Interface to Locks and Mutexes</h3></div></div></div><p>The file &lt;ext/concurrence.h&gt; contains all the higher-level
constructs for playing with threads. In contrast to the atomics layer, constructs for playing with threads. In contrast to the atomics layer,
the concurrence layer consists largely of types. All types are defined within <code class="code">namespace __gnu_cxx</code>. the concurrence layer consists largely of types. All types are defined within <code class="code">namespace __gnu_cxx</code>.
</p><p> </p><p>
@ -16,9 +16,9 @@ that support multiple threads.)
available locking available locking
policies: <code class="code">_S_single</code>, <code class="code">_S_mutex</code>, policies: <code class="code">_S_single</code>, <code class="code">_S_mutex</code>,
and <code class="code">_S_atomic</code>. and <code class="code">_S_atomic</code>.
</p><div class="itemizedlist"><ul type="disc"><li><p><code class="code">_S_single</code></p><p>Indicates single-threaded code that does not need locking. </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><code class="code">_S_single</code></p><p>Indicates single-threaded code that does not need locking.
</p></li><li><p><code class="code">_S_mutex</code></p><p>Indicates multi-threaded code using thread-layer abstractions. </p></li><li class="listitem"><p><code class="code">_S_mutex</code></p><p>Indicates multi-threaded code using thread-layer abstractions.
</p></li><li><p><code class="code">_S_atomic</code></p><p>Indicates multi-threaded code using atomic operations. </p></li><li class="listitem"><p><code class="code">_S_atomic</code></p><p>Indicates multi-threaded code using atomic operations.
</p></li></ul></div><p>The compile-time constant <code class="code">__default_lock_policy</code> is set </p></li></ul></div><p>The compile-time constant <code class="code">__default_lock_policy</code> is set
to one of the three values above, depending on characteristics of the to one of the three values above, depending on characteristics of the
host environment and the current compilation flags. host environment and the current compilation flags.
@ -30,7 +30,7 @@ community. This version takes a <code class="code">__mutex</code> reference, and
locks it during construction of <code class="code">__scoped_locke</code> and locks it during construction of <code class="code">__scoped_locke</code> and
unlocks it during destruction. This is an efficient way of locking unlocks it during destruction. This is an efficient way of locking
critical sections, while retaining exception-safety. critical sections, while retaining exception-safety.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.design.atomics"></a>Interface to Atomic Functions</h3></div></div></div><p> </p></div><div class="sect2" title="Interface to Atomic Functions"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.concurrency.design.atomics"></a>Interface to Atomic Functions</h3></div></div></div><p>
Two functions and one type form the base of atomic support. Two functions and one type form the base of atomic support.
</p><p>The type <code class="code">_Atomic_word</code> is a signed integral type </p><p>The type <code class="code">_Atomic_word</code> is a signed integral type
supporting atomic operations. supporting atomic operations.
@ -44,12 +44,12 @@ void
__atomic_add_dispatch(volatile _Atomic_word*, int); __atomic_add_dispatch(volatile _Atomic_word*, int);
</pre><p>Both of these functions are declared in the header file </pre><p>Both of these functions are declared in the header file
&lt;ext/atomicity.h&gt;, and are in <code class="code">namespace __gnu_cxx</code>. &lt;ext/atomicity.h&gt;, and are in <code class="code">namespace __gnu_cxx</code>.
</p><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
<code class="code"> <code class="code">
__exchange_and_add_dispatch __exchange_and_add_dispatch
</code> </code>
</p><p>Adds the second argument's value to the first argument. Returns the old value. </p><p>Adds the second argument's value to the first argument. Returns the old value.
</p></li><li><p> </p></li><li class="listitem"><p>
<code class="code"> <code class="code">
__atomic_add_dispatch __atomic_add_dispatch
</code> </code>
@ -63,11 +63,11 @@ __exchange_and_add_dispatch
</code> </code>
</p><p> </p><p>
Calls through to either of: Calls through to either of:
</p><div class="itemizedlist"><ul type="disc"><li><p><code class="code">__exchange_and_add</code> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><code class="code">__exchange_and_add</code>
</p><p>Multi-thread version. Inlined if compiler-generated builtin atomics </p><p>Multi-thread version. Inlined if compiler-generated builtin atomics
can be used, otherwise resolved at link time to a non-builtin code can be used, otherwise resolved at link time to a non-builtin code
sequence. sequence.
</p></li><li><p><code class="code">__exchange_and_add_single</code> </p></li><li class="listitem"><p><code class="code">__exchange_and_add_single</code>
</p><p>Single threaded version. Inlined.</p></li></ul></div><p>However, only <code class="code">__exchange_and_add_dispatch</code> </p><p>Single threaded version. Inlined.</p></li></ul></div><p>However, only <code class="code">__exchange_and_add_dispatch</code>
and <code class="code">__atomic_add_dispatch</code> should be used. These functions and <code class="code">__atomic_add_dispatch</code> should be used. These functions
can be used in a portable manner, regardless of the specific can be used in a portable manner, regardless of the specific

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 34. Containers</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bitmap_allocator.html" title="bitmap_allocator" /><link rel="next" href="bk01pt12ch34s02.html" title="HP/SGI" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 34. Containers</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><th width="60%" align="center">Part XII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 34. Containers</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bitmap_allocator.html" title="bitmap_allocator" /><link rel="next" href="bk01pt12ch34s02.html" title="HP/SGI" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 34. Containers</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch34s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers"></a>Chapter 34. Containers</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ext_containers.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch34s02.html">HP/SGI</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch34s03.html">Deprecated HP/SGI</a></span></dt></dl></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch34s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 34. Containers"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.containers"></a>Chapter 34. Containers</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ext_containers.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch34s02.html">HP/SGI</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch34s03.html">Deprecated HP/SGI</a></span></dt></dl></div><p>
</p><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.pbds"></a>Policy Based Data Structures</h2></div></div></div><p> </p><div class="sect1" title="Policy Based Data Structures"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.containers.pbds"></a>Policy Based Data Structures</h2></div></div></div><p>
<a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/ext/pb_ds/index.html" target="_top">More details here</a>. <a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/ext/pb_ds/index.html" target="_top">More details here</a>.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch34s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">bitmap_allocator </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> HP/SGI</td></tr></table></div></body></html> </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bitmap_allocator.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch34s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">bitmap_allocator </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> HP/SGI</td></tr></table></div></body></html>

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 40. Demangling</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_io.html" title="Chapter 39. Input and Output" /><link rel="next" href="ext_concurrency.html" title="Chapter 41. Concurrency" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 40. Demangling</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><th width="60%" align="center">Part XII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 40. Demangling</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_io.html" title="Chapter 39. Input and Output" /><link rel="next" href="ext_concurrency.html" title="Chapter 41. Concurrency" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 40. Demangling</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.demangle"></a>Chapter 40. Demangling</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 40. Demangling"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.demangle"></a>Chapter 40. Demangling</h2></div></div></div><p>
Transforming C++ ABI identifiers (like RTTI symbols) into the Transforming C++ ABI identifiers (like RTTI symbols) into the
original C++ source identifiers is called original C++ source identifiers is called
<span class="quote">demangling.</span> <span class="quote"><span class="quote">demangling.</span></span>
</p><p> </p><p>
If you have read the <a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/namespaceabi.html" target="_top">source If you have read the <a class="ulink" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/namespaceabi.html" target="_top">source
documentation for <code class="code">namespace abi</code></a> then you are documentation for <code class="code">namespace abi</code></a> then you are

View File

@ -1,41 +1,41 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 39. Input and Output</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_iterators.html" title="Chapter 38. Iterators" /><link rel="next" href="ext_demangling.html" title="Chapter 40. Demangling" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 39. Input and Output</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_iterators.html">Prev</a> </td><th width="60%" align="center">Part XII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 39. Input and Output</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_iterators.html" title="Chapter 38. Iterators" /><link rel="next" href="ext_demangling.html" title="Chapter 40. Demangling" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 39. Input and Output</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_iterators.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_demangling.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.io"></a>Chapter 39. Input and Output</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="ext_demangling.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 39. Input and Output"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.io"></a>Chapter 39. Input and Output</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ext_io.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></div><p>
Extensions allowing <code class="code">filebuf</code>s to be constructed from Extensions allowing <code class="code">filebuf</code>s to be constructed from
"C" types like FILE*s and file descriptors. "C" types like FILE*s and file descriptors.
</p><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.io.filebuf_derived"></a>Derived filebufs</h2></div></div></div><p>The v2 library included non-standard extensions to construct </p><div class="sect1" title="Derived filebufs"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.io.filebuf_derived"></a>Derived filebufs</h2></div></div></div><p>The v2 library included non-standard extensions to construct
<code class="code">std::filebuf</code>s from C stdio types such as <code class="code">std::filebuf</code>s from C stdio types such as
<code class="code">FILE*</code>s and POSIX file descriptors. <code class="code">FILE*</code>s and POSIX file descriptors.
Today the recommended way to use stdio types with libstdc++ Today the recommended way to use stdio types with libstdc++
IOStreams is via the <code class="code">stdio_filebuf</code> class (see below), IOStreams is via the <code class="code">stdio_filebuf</code> class (see below),
but earlier releases provided slightly different mechanisms. but earlier releases provided slightly different mechanisms.
</p><div class="itemizedlist"><ul type="disc"><li><p>3.0.x <code class="code">filebuf</code>s have another ctor with this signature: </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>3.0.x <code class="code">filebuf</code>s have another ctor with this signature:
<code class="code">basic_filebuf(__c_file_type*, ios_base::openmode, int_type); <code class="code">basic_filebuf(__c_file_type*, ios_base::openmode, int_type);
</code> </code>
This comes in very handy in a number of places, such as This comes in very handy in a number of places, such as
attaching Unix sockets, pipes, and anything else which uses file attaching Unix sockets, pipes, and anything else which uses file
descriptors, into the IOStream buffering classes. The three descriptors, into the IOStream buffering classes. The three
arguments are as follows: arguments are as follows:
</p><div class="itemizedlist"><ul type="circle"><li><p><code class="code">__c_file_type* F </code> </p><div class="itemizedlist"><ul class="itemizedlist" type="circle"><li class="listitem"><p><code class="code">__c_file_type* F </code>
// the __c_file_type typedef usually boils down to stdio's FILE // the __c_file_type typedef usually boils down to stdio's FILE
</p></li><li><p><code class="code">ios_base::openmode M </code> </p></li><li class="listitem"><p><code class="code">ios_base::openmode M </code>
// same as all the other uses of openmode // same as all the other uses of openmode
</p></li><li><p><code class="code">int_type B </code> </p></li><li class="listitem"><p><code class="code">int_type B </code>
// buffer size, defaults to BUFSIZ if not specified // buffer size, defaults to BUFSIZ if not specified
</p></li></ul></div><p> </p></li></ul></div><p>
For those wanting to use file descriptors instead of FILE*'s, I For those wanting to use file descriptors instead of FILE*'s, I
invite you to contemplate the mysteries of C's <code class="code">fdopen()</code>. invite you to contemplate the mysteries of C's <code class="code">fdopen()</code>.
</p></li><li><p>In library snapshot 3.0.95 and later, <code class="code">filebuf</code>s bring </p></li><li class="listitem"><p>In library snapshot 3.0.95 and later, <code class="code">filebuf</code>s bring
back an old extension: the <code class="code">fd()</code> member function. The back an old extension: the <code class="code">fd()</code> member function. The
integer returned from this function can be used for whatever file integer returned from this function can be used for whatever file
descriptors can be used for on your platform. Naturally, the descriptors can be used for on your platform. Naturally, the
library cannot track what you do on your own with a file descriptor, library cannot track what you do on your own with a file descriptor,
so if you perform any I/O directly, don't expect the library to be so if you perform any I/O directly, don't expect the library to be
aware of it. aware of it.
</p></li><li><p>Beginning with 3.1, the extra <code class="code">filebuf</code> constructor and </p></li><li class="listitem"><p>Beginning with 3.1, the extra <code class="code">filebuf</code> constructor and
the <code class="code">fd()</code> function were removed from the standard the <code class="code">fd()</code> function were removed from the standard
filebuf. Instead, <code class="code">&lt;ext/stdio_filebuf.h&gt;</code> contains filebuf. Instead, <code class="code">&lt;ext/stdio_filebuf.h&gt;</code> contains
a derived class called a derived class called

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 38. Iterators</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_numerics.html" title="Chapter 37. Numerics" /><link rel="next" href="ext_io.html" title="Chapter 39. Input and Output" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 38. Iterators</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_numerics.html">Prev</a> </td><th width="60%" align="center">Part XII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 38. Iterators</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_numerics.html" title="Chapter 37. Numerics" /><link rel="next" href="ext_io.html" title="Chapter 39. Input and Output" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 38. Iterators</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_numerics.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_io.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.iterators"></a>Chapter 38. Iterators</h2></div></div></div><p>24.3.2 describes <code class="code">struct iterator</code>, which didn't exist in the </th><td width="20%" align="right"> <a accesskey="n" href="ext_io.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 38. Iterators"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.iterators"></a>Chapter 38. Iterators</h2></div></div></div><p>24.3.2 describes <code class="code">struct iterator</code>, which didn't exist in the
original HP STL implementation (the language wasn't rich enough at the original HP STL implementation (the language wasn't rich enough at the
time). For backwards compatibility, base classes are provided which time). For backwards compatibility, base classes are provided which
declare the same nested typedefs: declare the same nested typedefs:
</p><div class="itemizedlist"><ul type="disc"><li><p>input_iterator</p></li><li><p>output_iterator</p></li><li><p>forward_iterator</p></li><li><p>bidirectional_iterator</p></li><li><p>random_access_iterator</p></li></ul></div><p>24.3.4 describes iterator operation <code class="code">distance</code>, which takes </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>input_iterator</p></li><li class="listitem"><p>output_iterator</p></li><li class="listitem"><p>forward_iterator</p></li><li class="listitem"><p>bidirectional_iterator</p></li><li class="listitem"><p>random_access_iterator</p></li></ul></div><p>24.3.4 describes iterator operation <code class="code">distance</code>, which takes
two iterators and returns a result. It is extended by another signature two iterators and returns a result. It is extended by another signature
which takes two iterators and a reference to a result. The result is which takes two iterators and a reference to a result. The result is
modified, and the function returns nothing. modified, and the function returns nothing.

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 37. Numerics</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_algorithms.html" title="Chapter 36. Algorithms" /><link rel="next" href="ext_iterators.html" title="Chapter 38. Iterators" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 37. Numerics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_algorithms.html">Prev</a> </td><th width="60%" align="center">Part XII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 37. Numerics</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="ext_algorithms.html" title="Chapter 36. Algorithms" /><link rel="next" href="ext_iterators.html" title="Chapter 38. Iterators" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 37. Numerics</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ext_algorithms.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_iterators.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.numerics"></a>Chapter 37. Numerics</h2></div></div></div><p>26.4, the generalized numeric operations such as accumulate, are extended </th><td width="20%" align="right"> <a accesskey="n" href="ext_iterators.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 37. Numerics"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.numerics"></a>Chapter 37. Numerics</h2></div></div></div><p>26.4, the generalized numeric operations such as accumulate, are extended
with the following functions: with the following functions:
</p><pre class="programlisting"> </p><pre class="programlisting">
power (x, n); power (x, n);

View File

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 35. Utilities</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bk01pt12ch34s03.html" title="Deprecated HP/SGI" /><link rel="next" href="ext_algorithms.html" title="Chapter 36. Algorithms" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 35. Utilities</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch34s03.html">Prev</a> </td><th width="60%" align="center">Part XII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 35. Utilities</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bk01pt12ch34s03.html" title="Deprecated HP/SGI" /><link rel="next" href="ext_algorithms.html" title="Chapter 36. Algorithms" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 35. Utilities</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch34s03.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="ext_algorithms.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.util"></a>Chapter 35. Utilities</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="ext_algorithms.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 35. Utilities"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.util"></a>Chapter 35. Utilities</h2></div></div></div><p>
The &lt;functional&gt; header contains many additional functors The &lt;functional&gt; header contains many additional functors
and helper functions, extending section 20.3. They are and helper functions, extending section 20.3. They are
implemented in the file stl_function.h: implemented in the file stl_function.h:
</p><div class="itemizedlist"><ul type="disc"><li><p><code class="code">identity_element</code> for addition and multiplication. * </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><code class="code">identity_element</code> for addition and multiplication. *
</p></li><li><p>The functor <code class="code">identity</code>, whose <code class="code">operator()</code> </p></li><li class="listitem"><p>The functor <code class="code">identity</code>, whose <code class="code">operator()</code>
returns the argument unchanged. * returns the argument unchanged. *
</p></li><li><p>Composition functors <code class="code">unary_function</code> and </p></li><li class="listitem"><p>Composition functors <code class="code">unary_function</code> and
<code class="code">binary_function</code>, and their helpers <code class="code">compose1</code> <code class="code">binary_function</code>, and their helpers <code class="code">compose1</code>
and <code class="code">compose2</code>. * and <code class="code">compose2</code>. *
</p></li><li><p><code class="code">select1st</code> and <code class="code">select2nd</code>, to strip pairs. * </p></li><li class="listitem"><p><code class="code">select1st</code> and <code class="code">select2nd</code>, to strip pairs. *
</p></li><li><p><code class="code">project1st</code> and <code class="code">project2nd</code>. * </p></li><li><p>A set of functors/functions which always return the same result. They </p></li><li class="listitem"><p><code class="code">project1st</code> and <code class="code">project2nd</code>. * </p></li><li class="listitem"><p>A set of functors/functions which always return the same result. They
are <code class="code">constant_void_fun</code>, <code class="code">constant_binary_fun</code>, are <code class="code">constant_void_fun</code>, <code class="code">constant_binary_fun</code>,
<code class="code">constant_unary_fun</code>, <code class="code">constant0</code>, <code class="code">constant_unary_fun</code>, <code class="code">constant0</code>,
<code class="code">constant1</code>, and <code class="code">constant2</code>. * </p></li><li><p>The class <code class="code">subtractive_rng</code>. * </p></li><li><p>mem_fun adaptor helpers <code class="code">mem_fun1</code> and <code class="code">constant1</code>, and <code class="code">constant2</code>. * </p></li><li class="listitem"><p>The class <code class="code">subtractive_rng</code>. * </p></li><li class="listitem"><p>mem_fun adaptor helpers <code class="code">mem_fun1</code> and
<code class="code">mem_fun1_ref</code> are provided for backwards compatibility. </p></li></ul></div><p> <code class="code">mem_fun1_ref</code> are provided for backwards compatibility. </p></li></ul></div><p>
20.4.1 can use several different allocators; they are described on the 20.4.1 can use several different allocators; they are described on the
main extensions page. main extensions page.

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 15. Facets aka Categories</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="localization.html" title="Part VI.  Localization" /><link rel="prev" href="locales.html" title="Chapter 14. Locales" /><link rel="next" href="codecvt.html" title="codecvt" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 15. Facets aka Categories</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="locales.html">Prev</a> </td><th width="60%" align="center">Part VI.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 15. Facets aka Categories</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="localization.html" title="Part VI.  Localization" /><link rel="prev" href="locales.html" title="Chapter 14. Locales" /><link rel="next" href="codecvt.html" title="codecvt" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 15. Facets aka Categories</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="locales.html">Prev</a> </td><th width="60%" align="center">Part VI. 
Localization Localization
</th><td width="20%" align="right"> <a accesskey="n" href="codecvt.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.localization.facet"></a>Chapter 15. Facets aka Categories</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="facets.html#manual.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="sect2"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="codecvt.html">codecvt</a></span></dt><dd><dl><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.design">Design</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.use">Use</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="messages.html">messages</a></span></dt><dd><dl><dt><span class="sect2"><a href="messages.html#facet.messages.req">Requirements</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.design">Design</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.use">Use</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.localization.facet.ctype"></a>ctype</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="facet.ctype.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id639240"></a>Specializations</h4></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="codecvt.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 15. Facets aka Categories"><div class="titlepage"><div><div><h2 class="title"><a id="manual.localization.facet"></a>Chapter 15. Facets aka Categories</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="facets.html#manual.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="sect2"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="codecvt.html">codecvt</a></span></dt><dd><dl><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.design">Design</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.use">Use</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="messages.html">messages</a></span></dt><dd><dl><dt><span class="sect2"><a href="messages.html#facet.messages.req">Requirements</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.design">Design</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.use">Use</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></div><div class="sect1" title="ctype"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.localization.facet.ctype"></a>ctype</h2></div></div></div><div class="sect2" title="Implementation"><div class="titlepage"><div><div><h3 class="title"><a id="facet.ctype.impl"></a>Implementation</h3></div></div></div><div class="sect3" title="Specializations"><div class="titlepage"><div><div><h4 class="title"><a id="id454077"></a>Specializations</h4></div></div></div><p>
For the required specialization codecvt&lt;wchar_t, char, mbstate_t&gt; , 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
@ -28,47 +28,47 @@ to wchar_t and wcsrtombs for conversions between wchar_t and char.
</p><p> </p><p>
Neither of these two required specializations deals with Unicode Neither of these two required specializations deals with Unicode
characters. characters.
</p></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="facet.ctype.future"></a>Future</h3></div></div></div><div class="itemizedlist"><ul type="disc"><li><p> </p></div></div><div class="sect2" title="Future"><div class="titlepage"><div><div><h3 class="title"><a id="facet.ctype.future"></a>Future</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
How to deal with the global locale issue? How to deal with the global locale issue?
</p></li><li><p> </p></li><li class="listitem"><p>
How to deal with different types than char, wchar_t? </p></li><li><p> How to deal with different types than char, wchar_t? </p></li><li class="listitem"><p>
Overlap between codecvt/ctype: narrow/widen Overlap between codecvt/ctype: narrow/widen
</p></li><li><p> </p></li><li class="listitem"><p>
Mask typedef in codecvt_base, argument types in codecvt. what Mask typedef in codecvt_base, argument types in codecvt. what
is know about this type? is know about this type?
</p></li><li><p> </p></li><li class="listitem"><p>
Why mask* argument in codecvt? Why mask* argument in codecvt?
</p></li><li><p> </p></li><li class="listitem"><p>
Can this be made (more) generic? is there a simple way to 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?
</p></li><li><p> </p></li><li class="listitem"><p>
Get the ctype&lt;wchar_t&gt;::mask stuff under control. Need to Get the ctype&lt;wchar_t&gt;::mask stuff under control. Need to
make some kind of static table, and not do lookup every time make some kind of static table, and not do lookup every time
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;
</p></li><li><p> </p></li><li class="listitem"><p>
Rename abstract base class. See if just smash-overriding is a Rename abstract base class. See if just smash-overriding is a
better approach. Clarify, add sanity to naming. better approach. Clarify, add sanity to naming.
</p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.ctype.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id621794"></a><p><span class="title"><i> </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.ctype.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry" title="The GNU C Library"><a id="id452097"></a><p><span class="title"><i>
The GNU C Library The GNU C Library
</i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id641198"></a><p><span class="title"><i> </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry" title="Correspondence"><a id="id471567"></a><p><span class="title"><i>
Correspondence Correspondence
</i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id734835"></a><p><span class="title"><i> </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry" title="ISO/IEC 14882:1998 Programming languages - C++"><a id="id471595"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++ ISO/IEC 14882:1998 Programming languages - C++
</i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id629980"></a><p><span class="title"><i> </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry" title="ISO/IEC 9899:1999 Programming languages - C"><a id="id427317"></a><p><span class="title"><i>
ISO/IEC 9899:1999 Programming languages - C ISO/IEC 9899:1999 Programming languages - C
</i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id629998"></a><p><span class="title"><i> </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry" title="The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)"><a id="id427335"></a><p><span class="title"><i>
The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004) The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
</i>. </span><span class="copyright">Copyright © 1999 </i>. </span><span class="copyright">Copyright © 1999
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid"> The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid">
<a class="ulink" href="http://www.unix.org/version3/ieee_std.html" target="_top"> <a class="ulink" href="http://www.unix.org/version3/ieee_std.html" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id619025"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="The C++ Programming Language, Special Edition"><a id="id424311"></a><p><span class="title"><i>
The C++ Programming Language, Special Edition The C++ Programming Language, Special Edition
</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername"> </i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley Addison Wesley
. </span></span></p></div><div class="biblioentry"><a id="id637327"></a><p><span class="title"><i> . </span></span></p></div><div class="biblioentry" title="Standard C++ IOStreams and Locales"><a id="id417496"></a><p><span class="title"><i>
Standard C++ IOStreams and Locales Standard C++ IOStreams and Locales
</i>. </span><span class="subtitle"> </i>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference Advanced Programmer's Guide and Reference

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 27. File Based Streams</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="io.html" title="Part XI.  Input and Output" /><link rel="prev" href="stringstreams.html" title="Chapter 26. Memory Based Streams" /><link rel="next" href="bk01pt11ch27s02.html" title="Binary Input and Output" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 27. File Based Streams</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="stringstreams.html">Prev</a> </td><th width="60%" align="center">Part XI.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 27. File Based Streams</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="io.html" title="Part XI.  Input and Output" /><link rel="prev" href="stringstreams.html" title="Chapter 26. Memory Based Streams" /><link rel="next" href="bk01pt11ch27s02.html" title="Binary Input and Output" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 27. File Based Streams</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="stringstreams.html">Prev</a> </td><th width="60%" align="center">Part XI. 
Input and Output Input and Output
</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt11ch27s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.io.filestreams"></a>Chapter 27. File Based Streams</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="fstreams.html#manual.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch27s02.html">Binary Input and Output</a></span></dt></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.io.filestreams.copying_a_file"></a>Copying a File</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="bk01pt11ch27s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 27. File Based Streams"><div class="titlepage"><div><div><h2 class="title"><a id="manual.io.filestreams"></a>Chapter 27. File Based Streams</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="fstreams.html#manual.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch27s02.html">Binary Input and Output</a></span></dt></dl></div><div class="sect1" title="Copying a File"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.io.filestreams.copying_a_file"></a>Copying a File</h2></div></div></div><p>
</p><p>So you want to copy a file quickly and easily, and most important, </p><p>So you want to copy a file quickly and easily, and most important,
completely portably. And since this is C++, you have an open completely portably. And since this is C++, you have an open
ifstream (call it IN) and an open ofstream (call it OUT): ifstream (call it IN) and an open ofstream (call it OUT):

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 9. Functors</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="utilities.html" title="Part IV.  Utilities" /><link rel="prev" href="utilities.html" title="Part IV.  Utilities" /><link rel="next" href="pairs.html" title="Chapter 10. Pairs" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. Functors</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="utilities.html">Prev</a> </td><th width="60%" align="center">Part IV.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 9. Functors</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="utilities.html" title="Part IV.  Utilities" /><link rel="prev" href="utilities.html" title="Part IV.  Utilities" /><link rel="next" href="pairs.html" title="Chapter 10. Pairs" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. Functors</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="utilities.html">Prev</a> </td><th width="60%" align="center">Part IV. 
Utilities Utilities
</th><td width="20%" align="right"> <a accesskey="n" href="pairs.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.util.functors"></a>Chapter 9. Functors</h2></div></div></div><p>If you don't know what functors are, you're not alone. Many people </th><td width="20%" align="right"> <a accesskey="n" href="pairs.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 9. Functors"><div class="titlepage"><div><div><h2 class="title"><a id="manual.util.functors"></a>Chapter 9. Functors</h2></div></div></div><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
the wheel, we will refer you to the introduction to the functor the wheel, we will refer you to the introduction to the functor
concept written by SGI as part of their STL, in concept written by SGI as part of their STL, in

View File

@ -1,37 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 4. Types</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="support.html" title="Part II.  Support" /><link rel="prev" href="bk01pt02pr01.html" title="" /><link rel="next" href="bk01pt02ch04s02.html" title="Numeric Properties" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. Types</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt02pr01.html">Prev</a> </td><th width="60%" align="center">Part II.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 4. Types</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="support.html" title="Part II.  Support" /><link rel="prev" href="bk01pt02pr01.html" title="" /><link rel="next" href="bk01pt02ch04s02.html" title="Numeric Properties" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. Types</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt02pr01.html">Prev</a> </td><th width="60%" align="center">Part II. 
Support Support
</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt02ch04s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.support.types"></a>Chapter 4. Types</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="fundamental_types.html#manual.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="sect1"><a href="bk01pt02ch04s02.html">Numeric Properties</a></span></dt><dt><span class="sect1"><a href="bk01pt02ch04s03.html">NULL</a></span></dt></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.support.types.fundamental"></a>Fundamental Types</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="bk01pt02ch04s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 4. Types"><div class="titlepage"><div><div><h2 class="title"><a id="manual.support.types"></a>Chapter 4. Types</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="fundamental_types.html#manual.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="sect1"><a href="bk01pt02ch04s02.html">Numeric Properties</a></span></dt><dt><span class="sect1"><a href="bk01pt02ch04s03.html">NULL</a></span></dt></dl></div><div class="sect1" title="Fundamental Types"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.support.types.fundamental"></a>Fundamental Types</h2></div></div></div><p>
C++ has the following builtin types: C++ has the following builtin types:
</p><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
char char
</p></li><li><p> </p></li><li class="listitem"><p>
signed char signed char
</p></li><li><p> </p></li><li class="listitem"><p>
unsigned char unsigned char
</p></li><li><p> </p></li><li class="listitem"><p>
signed short signed short
</p></li><li><p> </p></li><li class="listitem"><p>
signed int signed int
</p></li><li><p> </p></li><li class="listitem"><p>
signed long signed long
</p></li><li><p> </p></li><li class="listitem"><p>
unsigned short unsigned short
</p></li><li><p> </p></li><li class="listitem"><p>
unsigned int unsigned int
</p></li><li><p> </p></li><li class="listitem"><p>
unsigned long unsigned long
</p></li><li><p> </p></li><li class="listitem"><p>
bool bool
</p></li><li><p> </p></li><li class="listitem"><p>
wchar_t wchar_t
</p></li><li><p> </p></li><li class="listitem"><p>
float float
</p></li><li><p> </p></li><li class="listitem"><p>
double double
</p></li><li><p> </p></li><li class="listitem"><p>
long double long double
</p></li></ul></div><p> </p></li></ul></div><p>
These fundamental types are always available, without having to These fundamental types are always available, without having to

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 22. Generalized Operations</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="numerics.html" title="Part X.  Numerics" /><link rel="prev" href="complex.html" title="Chapter 21. Complex" /><link rel="next" href="numerics_and_c.html" title="Chapter 23. Interacting with C" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 22. Generalized Operations</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="complex.html">Prev</a> </td><th width="60%" align="center">Part X.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 22. Generalized Operations</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="numerics.html" title="Part X.  Numerics" /><link rel="prev" href="complex.html" title="Chapter 21. Complex" /><link rel="next" href="numerics_and_c.html" title="Chapter 23. Interacting with C" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 22. Generalized Operations</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="complex.html">Prev</a> </td><th width="60%" align="center">Part X. 
Numerics Numerics
</th><td width="20%" align="right"> <a accesskey="n" href="numerics_and_c.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.numerics.generalized_ops"></a>Chapter 22. Generalized Operations</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="numerics_and_c.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 22. Generalized Operations"><div class="titlepage"><div><div><h2 class="title"><a id="manual.numerics.generalized_ops"></a>Chapter 22. Generalized Operations</h2></div></div></div><p>
</p><p>There are four generalized functions in the &lt;numeric&gt; header </p><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><div class="itemizedlist"><ul type="disc"><li><p><code class="code">accumulate</code></p></li><li><p><code class="code">inner_product</code></p></li><li><p><code class="code">partial_sum</code></p></li><li><p><code class="code">adjacent_difference</code></p></li></ul></div><p>Here is a simple example of the two forms of <code class="code">accumulate</code>. </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><code class="code">accumulate</code></p></li><li class="listitem"><p><code class="code">inner_product</code></p></li><li class="listitem"><p><code class="code">partial_sum</code></p></li><li class="listitem"><p><code class="code">adjacent_difference</code></p></li></ul></div><p>Here is a simple example of the two forms of <code class="code">accumulate</code>.
</p><pre class="programlisting"> </p><pre class="programlisting">
int ar[50]; int ar[50];
int someval = somefunction(); int someval = somefunction();

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Porting to New Hardware or Operating Systems</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; internals&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="next" href="test.html" title="Test" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Porting to New Hardware or Operating Systems</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_porting.html">Prev</a> </td><th width="60%" align="center">Appendix B.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Porting to New Hardware or Operating Systems</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; internals&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="prev" href="appendix_porting.html" title="Appendix B.  Porting and Maintenance" /><link rel="next" href="test.html" title="Test" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Porting to New Hardware or Operating Systems</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="appendix_porting.html">Prev</a> </td><th width="60%" align="center">Appendix B. 
Porting and Maintenance Porting and Maintenance
</th><td width="20%" align="right"> <a accesskey="n" href="test.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appendix.porting.internals"></a>Porting to New Hardware or Operating Systems</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="test.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Porting to New Hardware or Operating Systems"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="appendix.porting.internals"></a>Porting to New Hardware or Operating Systems</h2></div></div></div><p>
</p><p>This document explains how to port libstdc++ (the GNU C++ library) to </p><p>This document explains how to port libstdc++ (the GNU C++ library) to
a new target. a new target.
</p><p>In order to make the GNU C++ library (libstdc++) work with a new </p><p>In order to make the GNU C++ library (libstdc++) work with a new
@ -20,7 +20,7 @@ works. It is difficult to test the C++ compiler without a working
library, but you should at least try some minimal test cases. library, but you should at least try some minimal test cases.
</p><p>(Note that what we think of as a "target," the library refers to as </p><p>(Note that what we think of as a "target," the library refers to as
a "host." The comment at the top of <code class="code">configure.ac</code> explains why.) a "host." The comment at the top of <code class="code">configure.ac</code> explains why.)
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="internals.os"></a>Operating System</h3></div></div></div><p>If you are porting to a new operating system (as opposed to a new chip </p><div class="sect2" title="Operating System"><div class="titlepage"><div><div><h3 class="title"><a id="internals.os"></a>Operating System</h3></div></div></div><p>If you are porting to a new operating system (as opposed to a new chip
using an existing operating system), you will need to create a new using an existing operating system), you will need to create a new
directory in the <code class="code">config/os</code> hierarchy. For example, the IRIX directory in the <code class="code">config/os</code> hierarchy. For example, the IRIX
configuration files are all in <code class="code">config/os/irix</code>. There is no set configuration files are all in <code class="code">config/os/irix</code>. There is no set
@ -99,7 +99,7 @@ this:
#endif #endif
</pre><p>We recommend copying an existing <code class="code">os_defines.h</code> to use as a </pre><p>We recommend copying an existing <code class="code">os_defines.h</code> to use as a
starting point. starting point.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="internals.cpu"></a>CPU</h3></div></div></div><p>If you are porting to a new chip (as opposed to a new operating system </p></div><div class="sect2" title="CPU"><div class="titlepage"><div><div><h3 class="title"><a id="internals.cpu"></a>CPU</h3></div></div></div><p>If you are porting to a new chip (as opposed to a new operating system
running on an existing chip), you will need to create a new directory in the running on an existing chip), you will need to create a new directory in the
<code class="code">config/cpu</code> hierarchy. Much like the <a class="link" href="internals.html#internals.os" title="Operating System">Operating system</a> setup, <code class="code">config/cpu</code> hierarchy. Much like the <a class="link" href="internals.html#internals.os" title="Operating System">Operating system</a> setup,
there are no strict rules on how to organize the CPU configuration there are no strict rules on how to organize the CPU configuration
@ -117,7 +117,7 @@ example, <code class="code">alpha</code>, <code class="code">alphaev5</code>, an
</p><p>The <code class="code">cpu_include_dir</code> sets default locations for the files controlling </p><p>The <code class="code">cpu_include_dir</code> sets default locations for the files controlling
<a class="link" href="internals.html#internals.thread_safety" title="Thread Safety">Thread safety</a> and <a class="link" href="internals.html#internals.numeric_limits" title="Numeric Limits">Numeric limits</a>, if the defaults are not <a class="link" href="internals.html#internals.thread_safety" title="Thread Safety">Thread safety</a> and <a class="link" href="internals.html#internals.numeric_limits" title="Numeric Limits">Numeric limits</a>, if the defaults are not
appropriate for your chip. appropriate for your chip.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="internals.char_types"></a>Character Types</h3></div></div></div><p>The library requires that you provide three header files to implement </p></div><div class="sect2" title="Character Types"><div class="titlepage"><div><div><h3 class="title"><a id="internals.char_types"></a>Character Types</h3></div></div></div><p>The library requires that you provide three header files to implement
character classification, analogous to that provided by the C libraries character classification, analogous to that provided by the C libraries
<code class="code">&lt;ctype.h&gt;</code> header. You can model these on the files provided in <code class="code">&lt;ctype.h&gt;</code> header. You can model these on the files provided in
<code class="code">config/os/generic</code>. However, these files will almost <code class="code">config/os/generic</code>. However, these files will almost
@ -279,7 +279,7 @@ from <code class="code">__low</code> up until <code class="code">__high</code> i
++__low; ++__low;
return __low; return __low;
} }
</pre></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="internals.thread_safety"></a>Thread Safety</h3></div></div></div><p>The C++ library string functionality requires a couple of atomic </pre></div><div class="sect2" title="Thread Safety"><div class="titlepage"><div><div><h3 class="title"><a id="internals.thread_safety"></a>Thread Safety</h3></div></div></div><p>The C++ library string functionality requires a couple of atomic
operations to provide thread-safety. If you don't take any special operations to provide thread-safety. If you don't take any special
action, the library will use stub versions of these functions that are action, the library will use stub versions of these functions that are
not thread-safe. They will work fine, unless your applications are not thread-safe. They will work fine, unless your applications are
@ -334,7 +334,7 @@ must be equivalent to those provided here, but using atomic operations:
{ {
*__mem += __val; *__mem += __val;
} }
</pre></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="internals.numeric_limits"></a>Numeric Limits</h3></div></div></div><p>The C++ library requires information about the fundamental data types, </pre></div><div class="sect2" title="Numeric Limits"><div class="titlepage"><div><div><h3 class="title"><a id="internals.numeric_limits"></a>Numeric Limits</h3></div></div></div><p>The C++ library requires information about the fundamental data types,
such as the minimum and maximum representable values of each type. such as the minimum and maximum representable values of each type.
You can define each of these values individually, but it is usually You can define each of these values individually, but it is usually
easiest just to indicate how many bits are used in each of the data easiest just to indicate how many bits are used in each of the data
@ -346,7 +346,7 @@ same values, you can provide a CPU-specific file instead so that you
do not have to provide the same definitions for each operating system. do not have to provide the same definitions for each operating system.
To take that approach, create a new file called <code class="code">cpu_limits.h</code> in To take that approach, create a new file called <code class="code">cpu_limits.h</code> in
your CPU configuration directory (see <a class="link" href="internals.html#internals.cpu" title="CPU">CPU</a>). your CPU configuration directory (see <a class="link" href="internals.html#internals.cpu" title="CPU">CPU</a>).
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="internals.libtool"></a>Libtool</h3></div></div></div><p>The C++ library is compiled, archived and linked with libtool. </p></div><div class="sect2" title="Libtool"><div class="titlepage"><div><div><h3 class="title"><a id="internals.libtool"></a>Libtool</h3></div></div></div><p>The C++ library is compiled, archived and linked with libtool.
Explaining the full workings of libtool is beyond the scope of this Explaining the full workings of libtool is beyond the scope of this
document, but there are a few, particular bits that are necessary for document, but there are a few, particular bits that are necessary for
porting. porting.

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part XI.  Input and Output</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="bk01pt10ch23s02.html" title="C99" /><link rel="next" href="iostream_objects.html" title="Chapter 24. Iostream Objects" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part XI.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part XI.  Input and Output</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="bk01pt10ch23s02.html" title="C99" /><link rel="next" href="iostream_objects.html" title="Chapter 24. Iostream Objects" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part XI. 
Input and Output Input and Output
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt10ch23s02.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="iostream_objects.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.io"></a>Part XI.  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt10ch23s02.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="iostream_objects.html">Next</a></td></tr></table><hr /></div><div class="part" title="Part XI.  Input and Output"><div class="titlepage"><div><div><h1 class="title"><a id="manual.io"></a>Part XI. 
Input and Output Input and Output
<a id="id585725" class="indexterm"></a> <a id="id436023" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="iostream_objects.html">24. Iostream Objects</a></span></dt><dt><span class="chapter"><a href="streambufs.html">25. Stream Buffers</a></span></dt><dd><dl><dt><span class="sect1"><a href="streambufs.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch25s02.html">Buffering</a></span></dt></dl></dd><dt><span class="chapter"><a href="stringstreams.html">26. Memory Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="stringstreams.html#manual.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="chapter"><a href="fstreams.html">27. File Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="fstreams.html#manual.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch27s02.html">Binary Input and Output</a></span></dt></dl></dd><dt><span class="chapter"><a href="io_and_c.html">28. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="io_and_c.html#manual.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch28s02.html">Performance</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt10ch23s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="iostream_objects.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">C99 </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 24. Iostream Objects</td></tr></table></div></body></html> </h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="iostream_objects.html">24. Iostream Objects</a></span></dt><dt><span class="chapter"><a href="streambufs.html">25. Stream Buffers</a></span></dt><dd><dl><dt><span class="sect1"><a href="streambufs.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch25s02.html">Buffering</a></span></dt></dl></dd><dt><span class="chapter"><a href="stringstreams.html">26. Memory Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="stringstreams.html#manual.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="chapter"><a href="fstreams.html">27. File Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="fstreams.html#manual.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch27s02.html">Binary Input and Output</a></span></dt></dl></dd><dt><span class="chapter"><a href="io_and_c.html">28. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="io_and_c.html#manual.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch28s02.html">Performance</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt10ch23s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="iostream_objects.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">C99 </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 24. Iostream Objects</td></tr></table></div></body></html>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 28. Interacting with C</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="io.html" title="Part XI.  Input and Output" /><link rel="prev" href="bk01pt11ch27s02.html" title="Binary Input and Output" /><link rel="next" href="bk01pt11ch28s02.html" title="Performance" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 28. Interacting with C</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt11ch27s02.html">Prev</a> </td><th width="60%" align="center">Part XI.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 28. Interacting with C</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="io.html" title="Part XI.  Input and Output" /><link rel="prev" href="bk01pt11ch27s02.html" title="Binary Input and Output" /><link rel="next" href="bk01pt11ch28s02.html" title="Performance" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 28. Interacting with C</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt11ch27s02.html">Prev</a> </td><th width="60%" align="center">Part XI. 
Input and Output Input and Output
</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt11ch28s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.io.c"></a>Chapter 28. Interacting with C</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="io_and_c.html#manual.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch28s02.html">Performance</a></span></dt></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.io.c.FILE"></a>Using FILE* and file descriptors</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="bk01pt11ch28s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 28. Interacting with C"><div class="titlepage"><div><div><h2 class="title"><a id="manual.io.c"></a>Chapter 28. Interacting with C</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="io_and_c.html#manual.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch28s02.html">Performance</a></span></dt></dl></div><div class="sect1" title="Using FILE* and file descriptors"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.io.c.FILE"></a>Using FILE* and file descriptors</h2></div></div></div><p>
See the <a class="link" href="ext_io.html" title="Chapter 39. Input and Output">extensions</a> for using See the <a class="link" href="ext_io.html" title="Chapter 39. Input and Output">extensions</a> for using
<span class="type">FILE</span> and <span class="type">file descriptors</span> with <span class="type">FILE</span> and <span class="type">file descriptors</span> with
<code class="classname">ofstream</code> and <code class="classname">ofstream</code> and

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 24. Iostream Objects</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="io.html" title="Part XI.  Input and Output" /><link rel="prev" href="io.html" title="Part XI.  Input and Output" /><link rel="next" href="streambufs.html" title="Chapter 25. Stream Buffers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 24. Iostream Objects</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="io.html">Prev</a> </td><th width="60%" align="center">Part XI.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 24. Iostream Objects</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="io.html" title="Part XI.  Input and Output" /><link rel="prev" href="io.html" title="Part XI.  Input and Output" /><link rel="next" href="streambufs.html" title="Chapter 25. Stream Buffers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 24. Iostream Objects</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="io.html">Prev</a> </td><th width="60%" align="center">Part XI. 
Input and Output Input and Output
</th><td width="20%" align="right"> <a accesskey="n" href="streambufs.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.io.objects"></a>Chapter 24. Iostream Objects</h2></div></div></div><p>To minimize the time you have to wait on the compiler, it's good to </th><td width="20%" align="right"> <a accesskey="n" href="streambufs.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 24. Iostream Objects"><div class="titlepage"><div><div><h2 class="title"><a id="manual.io.objects"></a>Chapter 24. Iostream Objects</h2></div></div></div><p>To minimize the time you have to wait on the compiler, it's good to
only include the headers you really need. Many people simply include only include the headers you really need. Many people simply include
&lt;iostream&gt; when they don't need to -- and that can <span class="emphasis"><em>penalize &lt;iostream&gt; when they don't need to -- and that can <span class="emphasis"><em>penalize
your runtime as well.</em></span> Here are some tips on which header to use your runtime as well.</em></span> Here are some tips on which header to use

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part VIII.  Iterators</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="bitset.html" title="bitset" /><link rel="next" href="bk01pt08ch19.html" title="Chapter 19. Predefined" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part VIII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part VIII.  Iterators</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="bitset.html" title="bitset" /><link rel="next" href="bk01pt08ch19.html" title="Chapter 19. Predefined" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part VIII. 
Iterators Iterators
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bitset.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt08ch19.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.iterators"></a>Part VIII.  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bitset.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt08ch19.html">Next</a></td></tr></table><hr /></div><div class="part" title="Part VIII.  Iterators"><div class="titlepage"><div><div><h1 class="title"><a id="manual.iterators"></a>Part VIII. 
Iterators Iterators
<a id="id632651" class="indexterm"></a> <a id="id437851" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="bk01pt08ch19.html">19. Predefined</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt08ch19.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="sect1"><a href="bk01pt08ch19s02.html">One Past the End</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bitset.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt08ch19.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">bitset </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 19. Predefined</td></tr></table></div></body></html> </h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="bk01pt08ch19.html">19. Predefined</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt08ch19.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="sect1"><a href="bk01pt08ch19s02.html">One Past the End</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bitset.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt08ch19.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">bitset </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 19. Predefined</td></tr></table></div></body></html>

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>License</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="status.html" title="Chapter 1. Status" /><link rel="prev" href="status.html" title="Chapter 1. Status" /><link rel="next" href="bugs.html" title="Bugs" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">License</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="status.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Status</th><td width="20%" align="right"> <a accesskey="n" href="bugs.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.status.license"></a>License</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>License</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="status.html" title="Chapter 1. Status" /><link rel="prev" href="status.html" title="Chapter 1. Status" /><link rel="next" href="bugs.html" title="Bugs" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">License</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="status.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Status</th><td width="20%" align="right"> <a accesskey="n" href="bugs.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="License"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.status.license"></a>License</h2></div></div></div><p>
There are two licenses affecting GNU libstdc++: one for the code, There are two licenses affecting GNU libstdc++: one for the code,
and one for the documentation. and one for the documentation.
</p><p> </p><p>
There is a license section in the FAQ regarding common <a class="link" href="../faq.html#faq.license" title="License">questions</a>. If you have more There is a license section in the FAQ regarding common <a class="link" href="../faq.html#faq.license" title="License">questions</a>. If you have more
questions, ask the FSF or the <a class="ulink" href="http://gcc.gnu.org/lists.html" target="_top">gcc mailing list</a>. questions, ask the FSF or the <a class="ulink" href="http://gcc.gnu.org/lists.html" target="_top">gcc mailing list</a>.
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.status.license.gpl"></a>The Code: GPL</h3></div></div></div><p> </p><div class="sect2" title="The Code: GPL"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.status.license.gpl"></a>The Code: GPL</h3></div></div></div><p>
The source code is distributed under the <a class="link" href="appendix_gpl.html" title="Appendix D.  GNU General Public License version 3">GNU General Public License version 3</a>, The source code is distributed under the <a class="link" href="appendix_gpl.html" title="Appendix D.  GNU General Public License version 3">GNU General Public License version 3</a>,
with the addition under section 7 of an exception described in with the addition under section 7 of an exception described in
the “<span class="quote">GCC Runtime Library Exception, version 3.1</span> the <span class="quote"><span class="quote">GCC Runtime Library Exception, version 3.1</span></span>
as follows (or see the file COPYING.RUNTIME): as follows (or see the file COPYING.RUNTIME):
</p><div class="literallayout"><p><br /> </p><div class="literallayout"><p><br />
GCC RUNTIME LIBRARY EXCEPTION<br /> GCC RUNTIME LIBRARY EXCEPTION<br />
@ -87,7 +87,7 @@ requirements of the license of GCC.<br />
    </p></div><p>     </p></div><p>
Hopefully that text is self-explanatory. If it isn't, you need to speak 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.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.status.license.fdl"></a>The Documentation: GPL, FDL</h3></div></div></div><p> </p></div><div class="sect2" title="The Documentation: GPL, FDL"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.status.license.fdl"></a>The Documentation: GPL, FDL</h3></div></div></div><p>
The documentation shipped with the library and made available over The documentation shipped with the library and made available over
the web, excluding the pages generated from source comments, are the web, excluding the pages generated from source comments, are
copyrighted by the Free Software Foundation, and placed under the copyrighted by the Free Software Foundation, and placed under the

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 14. Locales</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="localization.html" title="Part VI.  Localization" /><link rel="prev" href="localization.html" title="Part VI.  Localization" /><link rel="next" href="facets.html" title="Chapter 15. Facets aka Categories" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 14. Locales</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="localization.html">Prev</a> </td><th width="60%" align="center">Part VI.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 14. Locales</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="localization.html" title="Part VI.  Localization" /><link rel="prev" href="localization.html" title="Part VI.  Localization" /><link rel="next" href="facets.html" title="Chapter 15. Facets aka Categories" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 14. Locales</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="localization.html">Prev</a> </td><th width="60%" align="center">Part VI. 
Localization Localization
</th><td width="20%" align="right"> <a accesskey="n" href="facets.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.localization.locales"></a>Chapter 14. Locales</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="locales.html#manual.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="sect2"><a href="locales.html#locales.locale.req">Requirements</a></span></dt><dt><span class="sect2"><a href="locales.html#locales.locale.design">Design</a></span></dt><dt><span class="sect2"><a href="locales.html#locales.locale.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="locales.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.localization.locales.locale"></a>locale</h2></div></div></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="facets.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 14. Locales"><div class="titlepage"><div><div><h2 class="title"><a id="manual.localization.locales"></a>Chapter 14. Locales</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="locales.html#manual.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="sect2"><a href="locales.html#locales.locale.req">Requirements</a></span></dt><dt><span class="sect2"><a href="locales.html#locales.locale.design">Design</a></span></dt><dt><span class="sect2"><a href="locales.html#locales.locale.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="locales.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></div><div class="sect1" title="locale"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.localization.locales.locale"></a>locale</h2></div></div></div><p>
Describes the basic locale object, including nested 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,
class _Impl. class _Impl.
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="locales.locale.req"></a>Requirements</h3></div></div></div><p> </p><div class="sect2" title="Requirements"><div class="titlepage"><div><div><h3 class="title"><a id="locales.locale.req"></a>Requirements</h3></div></div></div><p>
Class locale is non-templatized and has two distinct types nested Class locale is non-templatized and has two distinct types nested
inside of it: inside of it:
</p><div class="blockquote"><blockquote class="blockquote"><p> </p><div class="blockquote"><blockquote class="blockquote"><p>
@ -21,11 +21,11 @@ called numpunct is the data objects that can be used to query for the
thousands separator is in the German locale. thousands separator is in the German locale.
</p><p> </p><p>
Literally, a facet is strictly defined: Literally, a facet is strictly defined:
</p><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
Containing the following public data member: Containing the following public data member:
</p><p> </p><p>
<code class="code">static locale::id id;</code> <code class="code">static locale::id id;</code>
</p></li><li><p> </p></li><li class="listitem"><p>
Derived from another facet: Derived from another facet:
</p><p> </p><p>
<code class="code">class gnu_codecvt: public std::ctype&lt;user-defined-type&gt;</code> <code class="code">class gnu_codecvt: public std::ctype&lt;user-defined-type&gt;</code>
@ -43,14 +43,14 @@ class id
</em></span> </em></span>
</p></blockquote></div><p> </p></blockquote></div><p>
Provides an index for looking up specific facets. Provides an index for looking up specific facets.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="locales.locale.design"></a>Design</h3></div></div></div><p> </p></div><div class="sect2" title="Design"><div class="titlepage"><div><div><h3 class="title"><a id="locales.locale.design"></a>Design</h3></div></div></div><p>
The major design challenge is fitting an object-orientated and The major design challenge is fitting an object-orientated and
non-global locale design on top of POSIX and other relevant standards, non-global locale design on top of POSIX and other relevant standards,
which include the Single Unix (nee X/Open.) which include the Single Unix (nee X/Open.)
</p><p> </p><p>
Because C and earlier versions of POSIX fall down so completely, Because C and earlier versions of POSIX fall down so completely,
portability is an issue. portability is an issue.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="locales.locale.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="locale.impl.c"></a>Interacting with "C" locales</h4></div></div></div><div class="itemizedlist"><ul type="disc"><li><p> </p></div><div class="sect2" title="Implementation"><div class="titlepage"><div><div><h3 class="title"><a id="locales.locale.impl"></a>Implementation</h3></div></div></div><div class="sect3" title="Interacting with &quot;C&quot; locales"><div class="titlepage"><div><div><h4 class="title"><a id="locale.impl.c"></a>Interacting with "C" locales</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
<code class="code">`locale -a`</code> displays available locales. <code class="code">`locale -a`</code> displays available locales.
</p><div class="blockquote"><blockquote class="blockquote"><pre class="programlisting"> </p><div class="blockquote"><blockquote class="blockquote"><pre class="programlisting">
af_ZA af_ZA
@ -351,7 +351,7 @@ zh_HK.utf8
zh_TW zh_TW
zh_TW.euctw zh_TW.euctw
zh_TW.utf8 zh_TW.utf8
</pre></blockquote></div></li><li><p> </pre></blockquote></div></li><li class="listitem"><p>
<code class="code">`locale`</code> displays environmental variables that <code class="code">`locale`</code> displays environmental variables that
impact how locale("") will be deduced. impact how locale("") will be deduced.
</p><div class="blockquote"><blockquote class="blockquote"><pre class="programlisting"> </p><div class="blockquote"><blockquote class="blockquote"><pre class="programlisting">
@ -380,43 +380,43 @@ global locale" (emphasis Paolo), that is:
particular on the working of locale(""), which constructs the locale particular on the working of locale(""), which constructs the locale
object from the environment of the running program, that is, in object from the environment of the running program, that is, in
practice, the set of LC_ALL, LANG, etc. variable of the shell. practice, the set of LC_ALL, LANG, etc. variable of the shell.
</p></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="locales.locale.future"></a>Future</h3></div></div></div><div class="itemizedlist"><ul type="disc"><li><p> </p></div></div><div class="sect2" title="Future"><div class="titlepage"><div><div><h3 class="title"><a id="locales.locale.future"></a>Future</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
Locale initialization: at what point does _S_classic, _S_global Locale initialization: at what point does _S_classic, _S_global
get initialized? Can named locales assume this initialization get initialized? Can named locales assume this initialization
has already taken place? has already taken place?
</p></li><li><p> </p></li><li class="listitem"><p>
Document how named locales error check when filling data Document how named locales error check when filling data
members. I.e., a fr_FR locale that doesn't have members. I.e., 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?
</p></li><li><p> </p></li><li class="listitem"><p>
Explain how locale aliasing happens. When does "de_DE" use "de" Explain how locale aliasing happens. When does "de_DE" use "de"
information? What is the rule for locales composed of just an information? What is the rule for locales composed of just an
ISO language code (say, "de") and locales with both an ISO ISO language code (say, "de") and locales with both an ISO
language code and ISO country code (say, "de_DE"). language code and ISO country code (say, "de_DE").
</p></li><li><p> </p></li><li class="listitem"><p>
What should non-required facet instantiations do? If the What should non-required facet instantiations do? If the
generic implementation is provided, then how to end-users generic implementation is provided, then how to end-users
provide specializations? provide specializations?
</p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="locales.locale.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id658666"></a><p><span class="title"><i> </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="locales.locale.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry" title="The GNU C Library"><a id="id508650"></a><p><span class="title"><i>
The GNU C Library The GNU C Library
</i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id679103"></a><p><span class="title"><i> </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry" title="Correspondence"><a id="id448472"></a><p><span class="title"><i>
Correspondence Correspondence
</i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id635262"></a><p><span class="title"><i> </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry" title="ISO/IEC 14882:1998 Programming languages - C++"><a id="id429400"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++ ISO/IEC 14882:1998 Programming languages - C++
</i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id709948"></a><p><span class="title"><i> </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry" title="ISO/IEC 9899:1999 Programming languages - C"><a id="id429418"></a><p><span class="title"><i>
ISO/IEC 9899:1999 Programming languages - C ISO/IEC 9899:1999 Programming languages - C
</i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id709967"></a><p><span class="title"><i> </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry" title="The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)"><a id="id474897"></a><p><span class="title"><i>
The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004) The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
</i>. </span><span class="copyright">Copyright © 1999 </i>. </span><span class="copyright">Copyright © 1999
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid"> The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid">
<a class="ulink" href="http://www.unix.org/version3/ieee_std.html" target="_top"> <a class="ulink" href="http://www.unix.org/version3/ieee_std.html" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id618881"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="The C++ Programming Language, Special Edition"><a id="id474924"></a><p><span class="title"><i>
The C++ Programming Language, Special Edition The C++ Programming Language, Special Edition
</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername"> </i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley Addison Wesley
. </span></span></p></div><div class="biblioentry"><a id="id641063"></a><p><span class="title"><i> . </span></span></p></div><div class="biblioentry" title="Standard C++ IOStreams and Locales"><a id="id436766"></a><p><span class="title"><i>
Standard C++ IOStreams and Locales Standard C++ IOStreams and Locales
</i>. </span><span class="subtitle"> </i>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference Advanced Programmer's Guide and Reference

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part VI.  Localization</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="bk01pt05ch13s06.html" title="CString (MFC)" /><link rel="next" href="locales.html" title="Chapter 14. Locales" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part VI.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part VI.  Localization</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="bk01pt05ch13s06.html" title="CString (MFC)" /><link rel="next" href="locales.html" title="Chapter 14. Locales" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part VI. 
Localization Localization
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt05ch13s06.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="locales.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.localization"></a>Part VI.  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt05ch13s06.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="locales.html">Next</a></td></tr></table><hr /></div><div class="part" title="Part VI.  Localization"><div class="titlepage"><div><div><h1 class="title"><a id="manual.localization"></a>Part VI. 
Localization Localization
<a id="id585411" class="indexterm"></a> <a id="id423124" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="locales.html">14. Locales</a></span></dt><dd><dl><dt><span class="sect1"><a href="locales.html#manual.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="sect2"><a href="locales.html#locales.locale.req">Requirements</a></span></dt><dt><span class="sect2"><a href="locales.html#locales.locale.design">Design</a></span></dt><dt><span class="sect2"><a href="locales.html#locales.locale.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="locales.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="facets.html">15. Facets aka Categories</a></span></dt><dd><dl><dt><span class="sect1"><a href="facets.html#manual.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="sect2"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="codecvt.html">codecvt</a></span></dt><dd><dl><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.design">Design</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.use">Use</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="messages.html">messages</a></span></dt><dd><dl><dt><span class="sect2"><a href="messages.html#facet.messages.req">Requirements</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.design">Design</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.use">Use</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt05ch13s06.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="locales.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">CString (MFC) </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 14. Locales</td></tr></table></div></body></html> </h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="locales.html">14. Locales</a></span></dt><dd><dl><dt><span class="sect1"><a href="locales.html#manual.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="sect2"><a href="locales.html#locales.locale.req">Requirements</a></span></dt><dt><span class="sect2"><a href="locales.html#locales.locale.design">Design</a></span></dt><dt><span class="sect2"><a href="locales.html#locales.locale.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="locales.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="facets.html">15. Facets aka Categories</a></span></dt><dd><dl><dt><span class="sect1"><a href="facets.html#manual.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="sect2"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="codecvt.html">codecvt</a></span></dt><dd><dl><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.design">Design</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.use">Use</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="messages.html">messages</a></span></dt><dd><dl><dt><span class="sect2"><a href="messages.html#facet.messages.req">Requirements</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.design">Design</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.use">Use</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt05ch13s06.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="locales.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">CString (MFC) </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 14. Locales</td></tr></table></div></body></html>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Make</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="setup.html" title="Chapter 2. Setup" /><link rel="prev" href="configure.html" title="Configure" /><link rel="next" href="using.html" title="Chapter 3. Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Make</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="configure.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td width="20%" align="right"> <a accesskey="n" href="using.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.make"></a>Make</h2></div></div></div><p>If you have never done this before, you should read the basic <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Make</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="setup.html" title="Chapter 2. Setup" /><link rel="prev" href="configure.html" title="Configure" /><link rel="next" href="using.html" title="Chapter 3. Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Make</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="configure.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td width="20%" align="right"> <a accesskey="n" href="using.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="Make"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.make"></a>Make</h2></div></div></div><p>If you have never done this before, you should read the basic
<a class="ulink" href="http://gcc.gnu.org/install/" target="_top">GCC Installation <a class="ulink" href="http://gcc.gnu.org/install/" target="_top">GCC Installation
Instructions</a> first. Read <span class="emphasis"><em>all of them</em></span>. Instructions</a> first. Read <span class="emphasis"><em>all of them</em></span>.
<span class="emphasis"><em>Twice.</em></span> <span class="emphasis"><em>Twice.</em></span>

View File

@ -1,25 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 11. Memory</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="utilities.html" title="Part IV.  Utilities" /><link rel="prev" href="pairs.html" title="Chapter 10. Pairs" /><link rel="next" href="auto_ptr.html" title="auto_ptr" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 11. Memory</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="pairs.html">Prev</a> </td><th width="60%" align="center">Part IV.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 11. Memory</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="utilities.html" title="Part IV.  Utilities" /><link rel="prev" href="pairs.html" title="Chapter 10. Pairs" /><link rel="next" href="auto_ptr.html" title="auto_ptr" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 11. Memory</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="pairs.html">Prev</a> </td><th width="60%" align="center">Part IV. 
Utilities Utilities
</th><td width="20%" align="right"> <a accesskey="n" href="auto_ptr.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.util.memory"></a>Chapter 11. Memory</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="memory.html#manual.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="sect2"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="sect1"><a href="auto_ptr.html">auto_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="auto_ptr.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="sect2"><a href="auto_ptr.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="shared_ptr.html">shared_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.using">Use</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></div><p> </th><td width="20%" align="right"> <a accesskey="n" href="auto_ptr.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 11. Memory"><div class="titlepage"><div><div><h2 class="title"><a id="manual.util.memory"></a>Chapter 11. Memory</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="memory.html#manual.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="sect2"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="sect2"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="sect1"><a href="auto_ptr.html">auto_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="auto_ptr.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="sect2"><a href="auto_ptr.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="shared_ptr.html">shared_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.using">Use</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></div><p>
Memory contains three general areas. First, function and operator Memory contains three general areas. First, function and operator
calls via <code class="function">new</code> and <code class="function">delete</code> calls via <code class="function">new</code> and <code class="function">delete</code>
operator or member function calls. Second, allocation via operator or member function calls. Second, allocation via
<code class="classname">allocator</code>. And finally, smart pointer and <code class="classname">allocator</code>. And finally, smart pointer and
intelligent pointer abstractions. intelligent pointer abstractions.
</p><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.util.memory.allocator"></a>Allocators</h2></div></div></div><p> </p><div class="sect1" title="Allocators"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.util.memory.allocator"></a>Allocators</h2></div></div></div><p>
Memory management for Standard Library entities is encapsulated in a Memory management for Standard Library entities is encapsulated in a
class template called <code class="classname">allocator</code>. The class template called <code class="classname">allocator</code>. The
<code class="classname">allocator</code> abstraction is used throughout the <code class="classname">allocator</code> abstraction is used throughout the
library in <code class="classname">string</code>, container classes, library in <code class="classname">string</code>, container classes,
algorithms, and parts of iostreams. This class, and base classes of algorithms, and parts of iostreams. This class, and base classes of
it, are the superset of available free store (“<span class="quote">heap</span>”) it, are the superset of available free store (<span class="quote"><span class="quote">heap</span></span>)
management classes. management classes.
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.req"></a>Requirements</h3></div></div></div><p> </p><div class="sect2" title="Requirements"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.req"></a>Requirements</h3></div></div></div><p>
The C++ standard only gives a few directives in this area: The C++ standard only gives a few directives in this area:
</p><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
When you add elements to a container, and the container must When you add elements to a container, and the container must
allocate more memory to hold them, the container makes the allocate more memory to hold them, the container makes the
request via its <span class="type">Allocator</span> template request via its <span class="type">Allocator</span> template
@ -27,10 +27,10 @@
<span class="type">allocator_type</span>. This includes adding chars <span class="type">allocator_type</span>. This includes adding chars
to the string class, which acts as a regular STL container in to the string class, which acts as a regular STL container in
this respect. this respect.
</p></li><li><p> </p></li><li class="listitem"><p>
The default <span class="type">Allocator</span> argument of every The default <span class="type">Allocator</span> argument of every
container-of-T is <code class="classname">allocator&lt;T&gt;</code>. container-of-T is <code class="classname">allocator&lt;T&gt;</code>.
</p></li><li><p> </p></li><li class="listitem"><p>
The interface of the <code class="classname">allocator&lt;T&gt;</code> class is The interface of the <code class="classname">allocator&lt;T&gt;</code> class is
extremely simple. It has about 20 public declarations (nested extremely simple. It has about 20 public declarations (nested
typedefs, member functions, etc), but the two which concern us most typedefs, member functions, etc), but the two which concern us most
@ -44,7 +44,7 @@
<span class="type">T</span>'s to allocate space for, <span class="emphasis"><em>not their <span class="type">T</span>'s to allocate space for, <span class="emphasis"><em>not their
total size</em></span>. total size</em></span>.
(This is a simplification; the real signatures use nested typedefs.) (This is a simplification; the real signatures use nested typedefs.)
</p></li><li><p> </p></li><li class="listitem"><p>
The storage is obtained by calling <code class="function">::operator The storage is obtained by calling <code class="function">::operator
new</code>, but it is unspecified when or how new</code>, but it is unspecified when or how
often this function is called. The use of the often this function is called. The use of the
@ -54,7 +54,7 @@
</p></li></ul></div><p> </p></li></ul></div><p>
Complete details cam be found in the C++ standard, look in Complete details cam be found in the C++ standard, look in
<code class="constant">[20.4 Memory]</code>. <code class="constant">[20.4 Memory]</code>.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.design_issues"></a>Design Issues</h3></div></div></div><p> </p></div><div class="sect2" title="Design Issues"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.design_issues"></a>Design Issues</h3></div></div></div><p>
The easiest way of fulfilling the requirements is to call The easiest way of fulfilling the requirements is to call
<code class="function">operator new</code> each time a container needs <code class="function">operator new</code> each time a container needs
memory, and to call <code class="function">operator delete</code> each time memory, and to call <code class="function">operator delete</code> each time
@ -93,7 +93,7 @@
or loading and unloading shared objects in memory. As such, using or loading and unloading shared objects in memory. As such, using
caching allocators on systems that do not support caching allocators on systems that do not support
<code class="function">abi::__cxa_atexit</code> is not recommended. <code class="function">abi::__cxa_atexit</code> is not recommended.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id712986"></a>Interface Design</h4></div></div></div><p> </p></div><div class="sect2" title="Implementation"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.impl"></a>Implementation</h3></div></div></div><div class="sect3" title="Interface Design"><div class="titlepage"><div><div><h4 class="title"><a id="id481448"></a>Interface Design</h4></div></div></div><p>
The only allocator interface that The only allocator interface that
is support is the standard C++ interface. As such, all STL is support is the standard C++ interface. As such, all STL
containers have been adjusted, and all external allocators have containers have been adjusted, and all external allocators have
@ -106,7 +106,7 @@
</p><p> </p><p>
The base class that <code class="classname">allocator</code> is derived from The base class that <code class="classname">allocator</code> is derived from
may not be user-configurable. may not be user-configurable.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id629278"></a>Selecting Default Allocation Policy</h4></div></div></div><p> </p></div><div class="sect3" title="Selecting Default Allocation Policy"><div class="titlepage"><div><div><h4 class="title"><a id="id522854"></a>Selecting Default Allocation Policy</h4></div></div></div><p>
It's difficult to pick an allocation strategy that will provide It's difficult to pick an allocation strategy that will provide
maximum utility, without excessively penalizing some behavior. In maximum utility, without excessively penalizing some behavior. In
fact, it's difficult just deciding which typical actions to measure fact, it's difficult just deciding which typical actions to measure
@ -114,7 +114,7 @@
</p><p> </p><p>
Three synthetic benchmarks have been created that provide data Three synthetic benchmarks have been created that provide data
that is used to compare different C++ allocators. These tests are: that is used to compare different C++ allocators. These tests are:
</p><div class="orderedlist"><ol type="1"><li><p> </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
Insertion. Insertion.
</p><p> </p><p>
Over multiple iterations, various STL container Over multiple iterations, various STL container
@ -123,7 +123,7 @@
Test source for <a class="ulink" href="http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/testsuite/performance/23_containers/insert/sequence.cc?view=markup" target="_top">sequence</a> Test source for <a class="ulink" href="http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/testsuite/performance/23_containers/insert/sequence.cc?view=markup" target="_top">sequence</a>
and <a class="ulink" href="http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/testsuite/performance/23_containers/insert/associative.cc?view=markup" target="_top">associative</a> and <a class="ulink" href="http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/testsuite/performance/23_containers/insert/associative.cc?view=markup" target="_top">associative</a>
containers. containers.
</p></li><li><p> </p></li><li class="listitem"><p>
Insertion and erasure in a multi-threaded environment. Insertion and erasure in a multi-threaded environment.
</p><p> </p><p>
This test shows the ability of the allocator to reclaim memory This test shows the ability of the allocator to reclaim memory
@ -131,7 +131,7 @@
for memory resources. for memory resources.
Test source Test source
<a class="ulink" href="http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/testsuite/performance/23_containers/insert_erase/associative.cc?view=markup" target="_top">here</a>. <a class="ulink" href="http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/testsuite/performance/23_containers/insert_erase/associative.cc?view=markup" target="_top">here</a>.
</p></li><li><p> </p></li><li class="listitem"><p>
A threaded producer/consumer model. A threaded producer/consumer model.
</p><p> </p><p>
Test source for Test source for
@ -143,7 +143,7 @@
The current default choice for The current default choice for
<code class="classname">allocator</code> is <code class="classname">allocator</code> is
<code class="classname">__gnu_cxx::new_allocator</code>. <code class="classname">__gnu_cxx::new_allocator</code>.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id711751"></a>Disabling Memory Caching</h4></div></div></div><p> </p></div><div class="sect3" title="Disabling Memory Caching"><div class="titlepage"><div><div><h4 class="title"><a id="id496610"></a>Disabling Memory Caching</h4></div></div></div><p>
In use, <code class="classname">allocator</code> may allocate and In use, <code class="classname">allocator</code> may allocate and
deallocate using implementation-specified strategies and deallocate using implementation-specified strategies and
heuristics. Because of this, every call to an allocator object's heuristics. Because of this, every call to an allocator object's
@ -179,7 +179,7 @@
environment, it likely means that you linked against objects environment, it likely means that you linked against objects
built against the older library (objects which might still using the built against the older library (objects which might still using the
cached allocations...). cached allocations...).
</p></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.using"></a>Using a Specific Allocator</h3></div></div></div><p> </p></div></div><div class="sect2" title="Using a Specific Allocator"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.using"></a>Using a Specific Allocator</h3></div></div></div><p>
You can specify different memory management schemes on a You can specify different memory management schemes on a
per-container basis, by overriding the default per-container basis, by overriding the default
<span class="type">Allocator</span> template parameter. For example, an easy <span class="type">Allocator</span> template parameter. For example, an easy
@ -190,7 +190,7 @@
Likewise, a debugging form of whichever allocator is currently in use: Likewise, a debugging form of whichever allocator is currently in use:
</p><pre class="programlisting"> </p><pre class="programlisting">
std::deque &lt;int, __gnu_cxx::debug_allocator&lt;std::allocator&lt;int&gt; &gt; &gt; debug_deque; std::deque &lt;int, __gnu_cxx::debug_allocator&lt;std::allocator&lt;int&gt; &gt; &gt; debug_deque;
</pre></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.custom"></a>Custom Allocators</h3></div></div></div><p> </pre></div><div class="sect2" title="Custom Allocators"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.custom"></a>Custom Allocators</h3></div></div></div><p>
Writing a portable C++ allocator would dictate that the interface Writing a portable C++ allocator would dictate that the interface
would look much like the one specified for would look much like the one specified for
<code class="classname">allocator</code>. Additional member functions, but <code class="classname">allocator</code>. Additional member functions, but
@ -199,7 +199,7 @@
Probably the best place to start would be to copy one of the Probably the best place to start would be to copy one of the
extension allocators: say a simple one like extension allocators: say a simple one like
<code class="classname">new_allocator</code>. <code class="classname">new_allocator</code>.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.ext"></a>Extension Allocators</h3></div></div></div><p> </p></div><div class="sect2" title="Extension Allocators"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.ext"></a>Extension Allocators</h3></div></div></div><p>
Several other allocators are provided as part of this Several other allocators are provided as part of this
implementation. The location of the extension allocators and their implementation. The location of the extension allocators and their
names have changed, but in all cases, functionality is names have changed, but in all cases, functionality is
@ -209,12 +209,12 @@
chart to track the changes. chart to track the changes.
</p><p> </p><p>
More details on each of these extension allocators follows. More details on each of these extension allocators follows.
</p><div class="orderedlist"><ol type="1"><li><p> </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
<code class="classname">new_allocator</code> <code class="classname">new_allocator</code>
</p><p> </p><p>
Simply wraps <code class="function">::operator new</code> Simply wraps <code class="function">::operator new</code>
and <code class="function">::operator delete</code>. and <code class="function">::operator delete</code>.
</p></li><li><p> </p></li><li class="listitem"><p>
<code class="classname">malloc_allocator</code> <code class="classname">malloc_allocator</code>
</p><p> </p><p>
Simply wraps <code class="function">malloc</code> and Simply wraps <code class="function">malloc</code> and
@ -222,7 +222,7 @@
out-of-memory handler (for out-of-memory handler (for
<code class="function">new</code>/<code class="function">delete</code> this is <code class="function">new</code>/<code class="function">delete</code> this is
taken care of elsewhere). taken care of elsewhere).
</p></li><li><p> </p></li><li class="listitem"><p>
<code class="classname">array_allocator</code> <code class="classname">array_allocator</code>
</p><p> </p><p>
Allows allocations of known and fixed sizes using existing Allows allocations of known and fixed sizes using existing
@ -235,7 +235,7 @@
allows the use of STL abstractions without runtime allows the use of STL abstractions without runtime
complications or overhead, even in situations such as program complications or overhead, even in situations such as program
startup. For usage examples, please consult the testsuite. startup. For usage examples, please consult the testsuite.
</p></li><li><p> </p></li><li class="listitem"><p>
<code class="classname">debug_allocator</code> <code class="classname">debug_allocator</code>
</p><p> </p><p>
A wrapper around an arbitrary allocator A. It passes on A wrapper around an arbitrary allocator A. It passes on
@ -244,13 +244,13 @@
to <code class="function">deallocate()</code>, the stored size is to <code class="function">deallocate()</code>, the stored size is
checked, and <code class="function">assert()</code> is used to checked, and <code class="function">assert()</code> is used to
guarantee they match. guarantee they match.
</p></li><li><p> </p></li><li class="listitem"><p>
<code class="classname">throw_allocator</code> <code class="classname">throw_allocator</code>
</p><p> </p><p>
Includes memory tracking and marking abilities as well as hooks for Includes memory tracking and marking abilities as well as hooks for
throwing exceptions at configurable intervals (including random, throwing exceptions at configurable intervals (including random,
all, none). all, none).
</p></li><li><p> </p></li><li class="listitem"><p>
<code class="classname">__pool_alloc</code> <code class="classname">__pool_alloc</code>
</p><p> </p><p>
A high-performance, single pool allocator. The reusable A high-performance, single pool allocator. The reusable
@ -296,23 +296,23 @@
(Note that the GCC thread abstraction layer allows us to provide (Note that the GCC thread abstraction layer allows us to provide
safe zero-overhead stubs for the threading routines, if threads safe zero-overhead stubs for the threading routines, if threads
were disabled at configuration time.) were disabled at configuration time.)
</p></li><li><p> </p></li><li class="listitem"><p>
<code class="classname">__mt_alloc</code> <code class="classname">__mt_alloc</code>
</p><p> </p><p>
A high-performance fixed-size allocator with A high-performance fixed-size allocator with
exponentially-increasing allocations. It has its own exponentially-increasing allocations. It has its own
documentation, found <a class="link" href="ext_allocators.html#manual.ext.allocator.mt" title="mt_allocator">here</a>. documentation, found <a class="link" href="ext_allocators.html#manual.ext.allocator.mt" title="mt_allocator">here</a>.
</p></li><li><p> </p></li><li class="listitem"><p>
<code class="classname">bitmap_allocator</code> <code class="classname">bitmap_allocator</code>
</p><p> </p><p>
A high-performance allocator that uses a bit-map to keep track A high-performance allocator that uses a bit-map to keep track
of the used and unused memory locations. It has its own of the used and unused memory locations. It has its own
documentation, found <a class="link" href="bitmap_allocator.html" title="bitmap_allocator">here</a>. documentation, found <a class="link" href="bitmap_allocator.html" title="bitmap_allocator">here</a>.
</p></li></ol></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id710951"></a><p><span class="title"><i> </p></li></ol></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry" title="ISO/IEC 14882:1998 Programming languages - C++"><a id="id431127"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++ ISO/IEC 14882:1998 Programming languages - C++
</i>. </span> </i>. </span>
isoc++_1998 isoc++_1998
<span class="pagenums">20.4 Memory. </span></p></div><div class="biblioentry"><a id="id710966"></a><p><span class="title"><i>The Standard Librarian: What Are Allocators Good <span class="pagenums">20.4 Memory. </span></p></div><div class="biblioentry" title="The Standard Librarian: What Are Allocators Good"><a id="id431142"></a><p><span class="title"><i>The Standard Librarian: What Are Allocators Good
</i>. </span> </i>. </span>
austernm austernm
<span class="author"><span class="firstname">Matt</span> <span class="surname">Austern</span>. </span><span class="publisher"><span class="publishername"> <span class="author"><span class="firstname">Matt</span> <span class="surname">Austern</span>. </span><span class="publisher"><span class="publishername">
@ -320,28 +320,28 @@
. </span></span><span class="biblioid"> . </span></span><span class="biblioid">
<a class="ulink" href="http://www.cuj.com/documents/s=8000/cujcexp1812austern/" target="_top"> <a class="ulink" href="http://www.cuj.com/documents/s=8000/cujcexp1812austern/" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id644430"></a><p><span class="title"><i>The Hoard Memory Allocator</i>. </span> . </span></p></div><div class="biblioentry" title="The Hoard Memory Allocator"><a id="id413862"></a><p><span class="title"><i>The Hoard Memory Allocator</i>. </span>
emeryb emeryb
<span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span><span class="biblioid"> <span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span><span class="biblioid">
<a class="ulink" href="http://www.cs.umass.edu/~emery/hoard/" target="_top"> <a class="ulink" href="http://www.cs.umass.edu/~emery/hoard/" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id689922"></a><p><span class="title"><i>Reconsidering Custom Memory Allocation</i>. </span> . </span></p></div><div class="biblioentry" title="Reconsidering Custom Memory Allocation"><a id="id499755"></a><p><span class="title"><i>Reconsidering Custom Memory Allocation</i>. </span>
bergerzorn bergerzorn
<span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span><span class="author"><span class="firstname">Ben</span> <span class="surname">Zorn</span>. </span><span class="author"><span class="firstname">Kathryn</span> <span class="surname">McKinley</span>. </span><span class="copyright">Copyright © 2002 OOPSLA. </span><span class="biblioid"> <span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span><span class="author"><span class="firstname">Ben</span> <span class="surname">Zorn</span>. </span><span class="author"><span class="firstname">Kathryn</span> <span class="surname">McKinley</span>. </span><span class="copyright">Copyright © 2002 OOPSLA. </span><span class="biblioid">
<a class="ulink" href="http://www.cs.umass.edu/~emery/pubs/berger-oopsla2002.pdf" target="_top"> <a class="ulink" href="http://www.cs.umass.edu/~emery/pubs/berger-oopsla2002.pdf" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id709355"></a><p><span class="title"><i>Allocator Types</i>. </span> . </span></p></div><div class="biblioentry" title="Allocator Types"><a id="id434571"></a><p><span class="title"><i>Allocator Types</i>. </span>
kreftlanger kreftlanger
<span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="publisher"><span class="publishername"> <span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="publisher"><span class="publishername">
C/C++ Users Journal C/C++ Users Journal
. </span></span><span class="biblioid"> . </span></span><span class="biblioid">
<a class="ulink" href="http://www.langer.camelot.de/Articles/C++Report/Allocators/Allocators.html" target="_top"> <a class="ulink" href="http://www.langer.camelot.de/Articles/C++Report/Allocators/Allocators.html" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id642689"></a><p><span class="title"><i>The C++ Programming Language</i>. </span> . </span></p></div><div class="biblioentry" title="The C++ Programming Language"><a id="id477417"></a><p><span class="title"><i>The C++ Programming Language</i>. </span>
tcpl tcpl
<span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 . </span><span class="pagenums">19.4 Allocators. </span><span class="publisher"><span class="publishername"> <span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 . </span><span class="pagenums">19.4 Allocators. </span><span class="publisher"><span class="publishername">
Addison Wesley Addison Wesley
. </span></span></p></div><div class="biblioentry"><a id="id614194"></a><p><span class="title"><i>Yalloc: A Recycling C++ Allocator</i>. </span> . </span></span></p></div><div class="biblioentry" title="Yalloc: A Recycling C++ Allocator"><a id="id425118"></a><p><span class="title"><i>Yalloc: A Recycling C++ Allocator</i>. </span>
yenf yenf
<span class="author"><span class="firstname">Felix</span> <span class="surname">Yen</span>. </span><span class="copyright">Copyright © . </span><span class="biblioid"> <span class="author"><span class="firstname">Felix</span> <span class="surname">Yen</span>. </span><span class="copyright">Copyright © . </span><span class="biblioid">
<a class="ulink" href="http://home.earthlink.net/~brimar/yalloc/" target="_top"> <a class="ulink" href="http://home.earthlink.net/~brimar/yalloc/" target="_top">

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>messages</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; messages&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="facets.html" title="Chapter 15. Facets aka Categories" /><link rel="prev" href="codecvt.html" title="codecvt" /><link rel="next" href="containers.html" title="Part VII.  Containers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">messages</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="codecvt.html">Prev</a> </td><th width="60%" align="center">Chapter 15. Facets aka Categories</th><td width="20%" align="right"> <a accesskey="n" href="containers.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.localization.facet.messages"></a>messages</h2></div></div></div><p> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>messages</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; messages&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="facets.html" title="Chapter 15. Facets aka Categories" /><link rel="prev" href="codecvt.html" title="codecvt" /><link rel="next" href="containers.html" title="Part VII.  Containers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">messages</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="codecvt.html">Prev</a> </td><th width="60%" align="center">Chapter 15. Facets aka Categories</th><td width="20%" align="right"> <a accesskey="n" href="containers.html">Next</a></td></tr></table><hr /></div><div class="sect1" title="messages"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.localization.facet.messages"></a>messages</h2></div></div></div><p>
The std::messages facet implements message retrieval functionality The std::messages facet implements message retrieval functionality
equivalent to Java's java.text.MessageFormat .using either GNU gettext equivalent to Java's java.text.MessageFormat .using either GNU gettext
or IEEE 1003.1-200 functions. or IEEE 1003.1-200 functions.
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="facet.messages.req"></a>Requirements</h3></div></div></div><p> </p><div class="sect2" title="Requirements"><div class="titlepage"><div><div><h3 class="title"><a id="facet.messages.req"></a>Requirements</h3></div></div></div><p>
The std::messages facet is probably the most vaguely defined facet in The std::messages facet is probably the most vaguely defined facet in
the standard library. It's assumed that this facility was built into the standard library. It's assumed that this facility was built into
the standard library in order to convert string literals from one the standard library in order to convert string literals from one
@ -53,7 +53,7 @@ be found, returns dfault.
-6- Effects: Releases unspecified resources associated with cat. -6- Effects: Releases unspecified resources associated with cat.
-7- Notes: The limit on such resources, if any, is implementation-defined. -7- Notes: The limit on such resources, if any, is implementation-defined.
</em></span> </em></span>
</p></blockquote></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="facet.messages.design"></a>Design</h3></div></div></div><p> </p></blockquote></div></div><div class="sect2" title="Design"><div class="titlepage"><div><div><h3 class="title"><a id="facet.messages.design"></a>Design</h3></div></div></div><p>
A couple of notes on the standard. A couple of notes on the standard.
</p><p> </p><p>
First, why is <code class="code">messages_base::catalog</code> specified as a typedef First, why is <code class="code">messages_base::catalog</code> specified as a typedef
@ -85,7 +85,7 @@ It is implicitly assumed that the locale for the default message
string in 'get' is in the "C" locale. Thus, all source code is assumed string in 'get' is in the "C" locale. Thus, all source code is assumed
to be written in English, so translations are always from "en_US" to to be written in English, so translations are always from "en_US" to
other, explicitly named locales. other, explicitly named locales.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="facet.messages.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="messages.impl.models"></a>Models</h4></div></div></div><p> </p></div><div class="sect2" title="Implementation"><div class="titlepage"><div><div><h3 class="title"><a id="facet.messages.impl"></a>Implementation</h3></div></div></div><div class="sect3" title="Models"><div class="titlepage"><div><div><h4 class="title"><a id="messages.impl.models"></a>Models</h4></div></div></div><p>
This is a relatively simple class, on the face of it. The standard This is a relatively simple class, on the face of it. The standard
specifies very little in concrete terms, so generic specifies very little in concrete terms, so generic
implementations that are conforming yet do very little are the implementations that are conforming yet do very little are the
@ -96,11 +96,11 @@ other, explicitly named locales.
</p><p> </p><p>
Three different mechanisms have been provided, selectable via Three different mechanisms have been provided, selectable via
configure flags: configure flags:
</p><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
generic generic
</p><p> </p><p>
This model does very little, and is what is used by default. This model does very little, and is what is used by default.
</p></li><li><p> </p></li><li class="listitem"><p>
gnu gnu
</p><p> </p><p>
The gnu model is complete and fully tested. It's based on the The gnu model is complete and fully tested. It's based on the
@ -110,7 +110,7 @@ other, explicitly named locales.
relatively straight-forward process and is lightly documented relatively straight-forward process and is lightly documented
below, and fully documented in gettext's distributed below, and fully documented in gettext's distributed
documentation. documentation.
</p></li><li><p> </p></li><li class="listitem"><p>
ieee_1003.1-200x ieee_1003.1-200x
</p><p> </p><p>
This is a complete, though untested, implementation based on This is a complete, though untested, implementation based on
@ -126,7 +126,7 @@ A new, standards-conformant non-virtual member function signature was
added for 'open' so that a directory could be specified with a given added for 'open' so that a directory could be specified with a given
message catalog. This simplifies calling conventions for the gnu message catalog. This simplifies calling conventions for the gnu
model. model.
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="messages.impl.gnu"></a>The GNU Model</h4></div></div></div><p> </p></div><div class="sect3" title="The GNU Model"><div class="titlepage"><div><div><h4 class="title"><a id="messages.impl.gnu"></a>The GNU Model</h4></div></div></div><p>
The messages facet, because it is retrieving and converting The messages facet, because it is retrieving and converting
between characters sets, depends on the ctype and perhaps the between characters sets, depends on the ctype and perhaps the
codecvt facet in a given locale. In addition, underlying "C" codecvt facet in a given locale. In addition, underlying "C"
@ -138,38 +138,38 @@ model.
Making the message catalogs can be initially tricky, but become Making the message catalogs can be initially tricky, but become
quite simple with practice. For complete info, see the gettext quite simple with practice. For complete info, see the gettext
documentation. Here's an idea of what is required: documentation. Here's an idea of what is required:
</p><div class="itemizedlist"><ul type="disc"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
Make a source file with the required string literals that need Make a source file with the required string literals that need
to be translated. See <code class="code">intl/string_literals.cc</code> for to be translated. See <code class="code">intl/string_literals.cc</code> for
an example. an example.
</p></li><li><p> </p></li><li class="listitem"><p>
Make initial catalog (see "4 Making the PO Template File" from Make initial catalog (see "4 Making the PO Template File" from
the gettext docs).</p><p> the gettext docs).</p><p>
<code class="code"> xgettext --c++ --debug string_literals.cc -o libstdc++.pot </code> <code class="code"> xgettext --c++ --debug string_literals.cc -o libstdc++.pot </code>
</p></li><li><p>Make language and country-specific locale catalogs.</p><p> </p></li><li class="listitem"><p>Make language and country-specific locale catalogs.</p><p>
<code class="code">cp libstdc++.pot fr_FR.po</code> <code class="code">cp libstdc++.pot fr_FR.po</code>
</p><p> </p><p>
<code class="code">cp libstdc++.pot de_DE.po</code> <code class="code">cp libstdc++.pot de_DE.po</code>
</p></li><li><p> </p></li><li class="listitem"><p>
Edit localized catalogs in emacs so that strings are Edit localized catalogs in emacs so that strings are
translated. translated.
</p><p> </p><p>
<code class="code">emacs fr_FR.po</code> <code class="code">emacs fr_FR.po</code>
</p></li><li><p>Make the binary mo files.</p><p> </p></li><li class="listitem"><p>Make the binary mo files.</p><p>
<code class="code">msgfmt fr_FR.po -o fr_FR.mo</code> <code class="code">msgfmt fr_FR.po -o fr_FR.mo</code>
</p><p> </p><p>
<code class="code">msgfmt de_DE.po -o de_DE.mo</code> <code class="code">msgfmt de_DE.po -o de_DE.mo</code>
</p></li><li><p>Copy the binary files into the correct directory structure.</p><p> </p></li><li class="listitem"><p>Copy the binary files into the correct directory structure.</p><p>
<code class="code">cp fr_FR.mo (dir)/fr_FR/LC_MESSAGES/libstdc++.mo</code> <code class="code">cp fr_FR.mo (dir)/fr_FR/LC_MESSAGES/libstdc++.mo</code>
</p><p> </p><p>
<code class="code">cp de_DE.mo (dir)/de_DE/LC_MESSAGES/libstdc++.mo</code> <code class="code">cp de_DE.mo (dir)/de_DE/LC_MESSAGES/libstdc++.mo</code>
</p></li><li><p>Use the new message catalogs.</p><p> </p></li><li class="listitem"><p>Use the new message catalogs.</p><p>
<code class="code">locale loc_de("de_DE");</code> <code class="code">locale loc_de("de_DE");</code>
</p><p> </p><p>
<code class="code"> <code class="code">
use_facet&lt;messages&lt;char&gt; &gt;(loc_de).open("libstdc++", locale(), dir); use_facet&lt;messages&lt;char&gt; &gt;(loc_de).open("libstdc++", locale(), dir);
</code> </code>
</p></li></ul></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="facet.messages.use"></a>Use</h3></div></div></div><p> </p></li></ul></div></div></div><div class="sect2" title="Use"><div class="titlepage"><div><div><h3 class="title"><a id="facet.messages.use"></a>Use</h3></div></div></div><p>
A simple example using the GNU model of message conversion. A simple example using the GNU model of message conversion.
</p><pre class="programlisting"> </p><pre class="programlisting">
#include &lt;iostream&gt; #include &lt;iostream&gt;
@ -191,9 +191,9 @@ void test01()
cout &lt;&lt; "thank you in german:" &lt;&lt; s02 &lt;&lt; '\n'; cout &lt;&lt; "thank you in german:" &lt;&lt; s02 &lt;&lt; '\n';
mssg_de.close(cat_de); mssg_de.close(cat_de);
} }
</pre></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="facet.messages.future"></a>Future</h3></div></div></div><div class="itemizedlist"><ul type="disc"><li><p> </pre></div><div class="sect2" title="Future"><div class="titlepage"><div><div><h3 class="title"><a id="facet.messages.future"></a>Future</h3></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
Things that are sketchy, or remain unimplemented: Things that are sketchy, or remain unimplemented:
</p><div class="itemizedlist"><ul type="circle"><li><p> </p><div class="itemizedlist"><ul class="itemizedlist" type="circle"><li class="listitem"><p>
_M_convert_from_char, _M_convert_to_char are in flux, _M_convert_from_char, _M_convert_to_char are in flux,
depending on how the library ends up doing character set depending on how the library ends up doing character set
conversions. It might not be possible to do a real character conversions. It might not be possible to do a real character
@ -201,13 +201,13 @@ void test01()
parameter for messages is not enough to instantiate the parameter for messages is not enough to instantiate the
codecvt facet (1 supplied, need at least 2 but would prefer codecvt facet (1 supplied, need at least 2 but would prefer
3). 3).
</p></li><li><p> </p></li><li class="listitem"><p>
There are issues with gettext needing the global locale set There are issues with gettext needing the global locale set
to extract a message. This dependence on the global locale to extract a message. This dependence on the global locale
makes the current "gnu" model non MT-safe. Future versions makes the current "gnu" model non MT-safe. Future versions
of glibc, i.e. glibc 2.3.x will fix this, and the C++ library of glibc, i.e. glibc 2.3.x will fix this, and the C++ library
bits are already in place. bits are already in place.
</p></li></ul></div></li><li><p> </p></li></ul></div></li><li class="listitem"><p>
Development versions of the GNU "C" library, glibc 2.3 will allow Development versions of the GNU "C" library, glibc 2.3 will allow
a more efficient, MT implementation of std::messages, and will a more efficient, MT implementation of std::messages, and will
allow the removal of the _M_name_messages data member. If this is allow the removal of the _M_name_messages data member. If this is
@ -216,7 +216,7 @@ void test01()
version of the "C" library is released, the marked parts of the version of the "C" library is released, the marked parts of the
messages implementation can be switched over to the new "C" messages implementation can be switched over to the new "C"
library functionality. library functionality.
</p></li><li><p> </p></li><li class="listitem"><p>
At some point in the near future, std::numpunct will probably use At some point in the near future, std::numpunct will probably use
std::messages facilities to implement truename/falsename std::messages facilities to implement truename/falsename
correctly. This is currently not done, but entries in correctly. This is currently not done, but entries in
@ -225,7 +225,7 @@ void test01()
configure/make hassles to make the installed library search its configure/make hassles to make the installed library search its
own catalog. Currently the libstdc++.mo catalog is only searched own catalog. Currently the libstdc++.mo catalog is only searched
for the testsuite cases involving messages members. for the testsuite cases involving messages members.
</p></li><li><p> The following member functions:</p><p> </p></li><li class="listitem"><p> The following member functions:</p><p>
<code class="code"> <code class="code">
catalog catalog
open(const basic_string&lt;char&gt;&amp; __s, const locale&amp; __loc) const open(const basic_string&lt;char&gt;&amp; __s, const locale&amp; __loc) const
@ -241,38 +241,38 @@ void test01()
model. As of this writing, it is unknown how to query to see model. As of this writing, it is unknown how to query to see
if a specified message catalog exists using the gettext if a specified message catalog exists using the gettext
package. package.
</p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.messages.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id699687"></a><p><span class="title"><i> </p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.messages.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry" title="The GNU C Library"><a id="id420938"></a><p><span class="title"><i>
The GNU C Library The GNU C Library
</i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling, and 7 Locales and Internationalization </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling, and 7 Locales and Internationalization
. </span></p></div><div class="biblioentry"><a id="id622574"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="Correspondence"><a id="id500134"></a><p><span class="title"><i>
Correspondence Correspondence
</i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id630269"></a><p><span class="title"><i> </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry" title="ISO/IEC 14882:1998 Programming languages - C++"><a id="id504300"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++ ISO/IEC 14882:1998 Programming languages - C++
</i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id630287"></a><p><span class="title"><i> </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry" title="ISO/IEC 9899:1999 Programming languages - C"><a id="id504319"></a><p><span class="title"><i>
ISO/IEC 9899:1999 Programming languages - C ISO/IEC 9899:1999 Programming languages - C
</i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id630306"></a><p><span class="title"><i> </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry" title="System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)"><a id="id504337"></a><p><span class="title"><i>
System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x) System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
</i>. </span><span class="copyright">Copyright © 1999 </i>. </span><span class="copyright">Copyright © 1999
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid"> The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid">
<a class="ulink" href="http://www.opengroup.org/austin/" target="_top"> <a class="ulink" href="http://www.opengroup.org/austin/" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id567615"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="The C++ Programming Language, Special Edition"><a id="id431617"></a><p><span class="title"><i>
The C++ Programming Language, Special Edition The C++ Programming Language, Special Edition
</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername"> </i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley Addison Wesley
. </span></span></p></div><div class="biblioentry"><a id="id621555"></a><p><span class="title"><i> . </span></span></p></div><div class="biblioentry" title="Standard C++ IOStreams and Locales"><a id="id413449"></a><p><span class="title"><i>
Standard C++ IOStreams and Locales Standard C++ IOStreams and Locales
</i>. </span><span class="subtitle"> </i>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference Advanced Programmer's Guide and Reference
. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley Longman, Inc.. </span><span class="publisher"><span class="publishername"> . </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley Longman, Inc.. </span><span class="publisher"><span class="publishername">
Addison Wesley Longman Addison Wesley Longman
. </span></span></p></div><div class="biblioentry"><a id="id646611"></a><p><span class="title"><i> . </span></span></p></div><div class="biblioentry" title="Java 2 Platform, Standard Edition, v 1.3.1 API Specification"><a id="id507891"></a><p><span class="title"><i>
Java 2 Platform, Standard Edition, v 1.3.1 API Specification Java 2 Platform, Standard Edition, v 1.3.1 API Specification
</i>. </span><span class="pagenums">java.util.Properties, java.text.MessageFormat, </i>. </span><span class="pagenums">java.util.Properties, java.text.MessageFormat,
java.util.Locale, java.util.ResourceBundle. </span><span class="biblioid"> java.util.Locale, java.util.ResourceBundle. </span><span class="biblioid">
<a class="ulink" href="http://java.sun.com/reference/api/index.html" target="_top"> <a class="ulink" href="http://java.sun.com/reference/api/index.html" target="_top">
</a> </a>
. </span></p></div><div class="biblioentry"><a id="id682026"></a><p><span class="title"><i> . </span></p></div><div class="biblioentry" title="GNU gettext tools, version 0.10.38, Native Language Support Library and Tools."><a id="id507912"></a><p><span class="title"><i>
GNU gettext tools, version 0.10.38, Native Language Support GNU gettext tools, version 0.10.38, Native Language Support
Library and Tools. Library and Tools.
</i>. </span><span class="biblioid"> </i>. </span><span class="biblioid">

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part X.  Numerics</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="bk01pt09ch20.html" title="Chapter 20. Mutating" /><link rel="next" href="complex.html" title="Chapter 21. Complex" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part X.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part X.  Numerics</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="bk01pt09ch20.html" title="Chapter 20. Mutating" /><link rel="next" href="complex.html" title="Chapter 21. Complex" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part X. 
Numerics Numerics
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt09ch20.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="complex.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.numerics"></a>Part X.  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt09ch20.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="complex.html">Next</a></td></tr></table><hr /></div><div class="part" title="Part X.  Numerics"><div class="titlepage"><div><div><h1 class="title"><a id="manual.numerics"></a>Part X. 
Numerics Numerics
<a id="id624917" class="indexterm"></a> <a id="id427052" class="indexterm"></a>
</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="complex.html">21. Complex</a></span></dt><dd><dl><dt><span class="sect1"><a href="complex.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="chapter"><a href="generalized_numeric_operations.html">22. Generalized Operations</a></span></dt><dt><span class="chapter"><a href="numerics_and_c.html">23. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="sect1"><a href="bk01pt10ch23s02.html">C99</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt09ch20.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="complex.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 20. Mutating </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 21. Complex</td></tr></table></div></body></html> </h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="complex.html">21. Complex</a></span></dt><dd><dl><dt><span class="sect1"><a href="complex.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="chapter"><a href="generalized_numeric_operations.html">22. Generalized Operations</a></span></dt><dt><span class="chapter"><a href="numerics_and_c.html">23. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="sect1"><a href="bk01pt10ch23s02.html">C99</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt09ch20.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="complex.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 20. Mutating </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 21. Complex</td></tr></table></div></body></html>

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 23. Interacting with C</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="numerics.html" title="Part X.  Numerics" /><link rel="prev" href="generalized_numeric_operations.html" title="Chapter 22. Generalized Operations" /><link rel="next" href="bk01pt10ch23s02.html" title="C99" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 23. Interacting with C</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="generalized_numeric_operations.html">Prev</a> </td><th width="60%" align="center">Part X.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 23. Interacting with C</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="numerics.html" title="Part X.  Numerics" /><link rel="prev" href="generalized_numeric_operations.html" title="Chapter 22. Generalized Operations" /><link rel="next" href="bk01pt10ch23s02.html" title="C99" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 23. Interacting with C</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="generalized_numeric_operations.html">Prev</a> </td><th width="60%" align="center">Part X. 
Numerics Numerics
</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt10ch23s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.numerics.c"></a>Chapter 23. Interacting with C</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="sect1"><a href="bk01pt10ch23s02.html">C99</a></span></dt></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="numerics.c.array"></a>Numerics vs. Arrays</h2></div></div></div><p>One of the major reasons why FORTRAN can chew through numbers so well </th><td width="20%" align="right"> <a accesskey="n" href="bk01pt10ch23s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 23. Interacting with C"><div class="titlepage"><div><div><h2 class="title"><a id="manual.numerics.c"></a>Chapter 23. Interacting with C</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="sect1"><a href="bk01pt10ch23s02.html">C99</a></span></dt></dl></div><div class="sect1" title="Numerics vs. Arrays"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="numerics.c.array"></a>Numerics vs. Arrays</h2></div></div></div><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
that C89 is not allowed to make, and neither is C++98. C99 adds a new that C89 is not allowed to make, and neither is C++98. C99 adds a new
keyword, <code class="code">restrict</code>, to apply to individual pointers. The keyword, <code class="code">restrict</code>, to apply to individual pointers. The

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 10. Pairs</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="utilities.html" title="Part IV.  Utilities" /><link rel="prev" href="functors.html" title="Chapter 9. Functors" /><link rel="next" href="memory.html" title="Chapter 11. Memory" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 10. Pairs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="functors.html">Prev</a> </td><th width="60%" align="center">Part IV.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 10. Pairs</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="utilities.html" title="Part IV.  Utilities" /><link rel="prev" href="functors.html" title="Chapter 9. Functors" /><link rel="next" href="memory.html" title="Chapter 11. Memory" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 10. Pairs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="functors.html">Prev</a> </td><th width="60%" align="center">Part IV. 
Utilities Utilities
</th><td width="20%" align="right"> <a accesskey="n" href="memory.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.util.pairs"></a>Chapter 10. Pairs</h2></div></div></div><p>The <code class="code">pair&lt;T1,T2&gt;</code> is a simple and handy way to </th><td width="20%" align="right"> <a accesskey="n" href="memory.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 10. Pairs"><div class="titlepage"><div><div><h2 class="title"><a id="manual.util.pairs"></a>Chapter 10. Pairs</h2></div></div></div><p>The <code class="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
type T2; they may be the same type, but you don't get anything type T2; they may be the same type, but you don't get anything
extra if they are. The two members can be accessed directly, as extra if they are. The two members can be accessed directly, as

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 31. Parallel Mode</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.3" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bk01pt12ch30s04.html" title="Design" /><link rel="next" href="bk01pt12ch31s02.html" title="Semantics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 31. Parallel Mode</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch30s04.html">Prev</a> </td><th width="60%" align="center">Part XII.  <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 31. Parallel Mode</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10; C++&#10; , &#10; library&#10; , &#10; parallel&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII.  Extensions" /><link rel="prev" href="bk01pt12ch30s04.html" title="Design" /><link rel="next" href="bk01pt12ch31s02.html" title="Semantics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 31. Parallel Mode</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt12ch30s04.html">Prev</a> </td><th width="60%" align="center">Part XII. 
Extensions Extensions
</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch31s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.parallel_mode"></a>Chapter 31. Parallel Mode</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch31s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch31s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch31s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch31s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></div><p> The libstdc++ parallel mode is an experimental parallel </th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch31s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 31. Parallel Mode"><div class="titlepage"><div><div><h2 class="title"><a id="manual.ext.parallel_mode"></a>Chapter 31. Parallel Mode</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch31s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch31s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch31s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s04.html#parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch31s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></div><p> The libstdc++ parallel mode is an experimental parallel
implementation of many algorithms the C++ Standard Library. implementation of many algorithms the C++ Standard Library.
</p><p> </p><p>
Several of the standard algorithms, for instance Several of the standard algorithms, for instance
@ -11,13 +11,13 @@ Several of the standard algorithms, for instance
annotations. These parallel mode constructs and can be invoked by annotations. These parallel mode constructs and can be invoked by
explicit source declaration or by compiling existing sources with a explicit source declaration or by compiling existing sources with a
specific compiler flag. specific compiler flag.
</p><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.intro"></a>Intro</h2></div></div></div><p>The following library components in the include </p><div class="sect1" title="Intro"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.intro"></a>Intro</h2></div></div></div><p>The following library components in the include
<code class="filename">numeric</code> are included in the parallel mode:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="function">std::accumulate</code></p></li><li><p><code class="function">std::adjacent_difference</code></p></li><li><p><code class="function">std::inner_product</code></p></li><li><p><code class="function">std::partial_sum</code></p></li></ul></div><p>The following library components in the include <code class="filename">numeric</code> are included in the parallel mode:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><code class="function">std::accumulate</code></p></li><li class="listitem"><p><code class="function">std::adjacent_difference</code></p></li><li class="listitem"><p><code class="function">std::inner_product</code></p></li><li class="listitem"><p><code class="function">std::partial_sum</code></p></li></ul></div><p>The following library components in the include
<code class="filename">algorithm</code> are included in the parallel mode:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="function">std::adjacent_find</code></p></li><li><p><code class="function">std::count</code></p></li><li><p><code class="function">std::count_if</code></p></li><li><p><code class="function">std::equal</code></p></li><li><p><code class="function">std::find</code></p></li><li><p><code class="function">std::find_if</code></p></li><li><p><code class="function">std::find_first_of</code></p></li><li><p><code class="function">std::for_each</code></p></li><li><p><code class="function">std::generate</code></p></li><li><p><code class="function">std::generate_n</code></p></li><li><p><code class="function">std::lexicographical_compare</code></p></li><li><p><code class="function">std::mismatch</code></p></li><li><p><code class="function">std::search</code></p></li><li><p><code class="function">std::search_n</code></p></li><li><p><code class="function">std::transform</code></p></li><li><p><code class="function">std::replace</code></p></li><li><p><code class="function">std::replace_if</code></p></li><li><p><code class="function">std::max_element</code></p></li><li><p><code class="function">std::merge</code></p></li><li><p><code class="function">std::min_element</code></p></li><li><p><code class="function">std::nth_element</code></p></li><li><p><code class="function">std::partial_sort</code></p></li><li><p><code class="function">std::partition</code></p></li><li><p><code class="function">std::random_shuffle</code></p></li><li><p><code class="function">std::set_union</code></p></li><li><p><code class="function">std::set_intersection</code></p></li><li><p><code class="function">std::set_symmetric_difference</code></p></li><li><p><code class="function">std::set_difference</code></p></li><li><p><code class="function">std::sort</code></p></li><li><p><code class="function">std::stable_sort</code></p></li><li><p><code class="function">std::unique_copy</code></p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="parallel_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry"><a id="id660222"></a><p><span class="title"><i> <code class="filename">algorithm</code> are included in the parallel mode:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><code class="function">std::adjacent_find</code></p></li><li class="listitem"><p><code class="function">std::count</code></p></li><li class="listitem"><p><code class="function">std::count_if</code></p></li><li class="listitem"><p><code class="function">std::equal</code></p></li><li class="listitem"><p><code class="function">std::find</code></p></li><li class="listitem"><p><code class="function">std::find_if</code></p></li><li class="listitem"><p><code class="function">std::find_first_of</code></p></li><li class="listitem"><p><code class="function">std::for_each</code></p></li><li class="listitem"><p><code class="function">std::generate</code></p></li><li class="listitem"><p><code class="function">std::generate_n</code></p></li><li class="listitem"><p><code class="function">std::lexicographical_compare</code></p></li><li class="listitem"><p><code class="function">std::mismatch</code></p></li><li class="listitem"><p><code class="function">std::search</code></p></li><li class="listitem"><p><code class="function">std::search_n</code></p></li><li class="listitem"><p><code class="function">std::transform</code></p></li><li class="listitem"><p><code class="function">std::replace</code></p></li><li class="listitem"><p><code class="function">std::replace_if</code></p></li><li class="listitem"><p><code class="function">std::max_element</code></p></li><li class="listitem"><p><code class="function">std::merge</code></p></li><li class="listitem"><p><code class="function">std::min_element</code></p></li><li class="listitem"><p><code class="function">std::nth_element</code></p></li><li class="listitem"><p><code class="function">std::partial_sort</code></p></li><li class="listitem"><p><code class="function">std::partition</code></p></li><li class="listitem"><p><code class="function">std::random_shuffle</code></p></li><li class="listitem"><p><code class="function">std::set_union</code></p></li><li class="listitem"><p><code class="function">std::set_intersection</code></p></li><li class="listitem"><p><code class="function">std::set_symmetric_difference</code></p></li><li class="listitem"><p><code class="function">std::set_difference</code></p></li><li class="listitem"><p><code class="function">std::sort</code></p></li><li class="listitem"><p><code class="function">std::stable_sort</code></p></li><li class="listitem"><p><code class="function">std::unique_copy</code></p></li></ul></div></div><div class="bibliography" title="Bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="parallel_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry" title="Parallelization of Bulk Operations for STL Dictionaries"><a id="id417661"></a><p><span class="title"><i>
Parallelization of Bulk Operations for STL Dictionaries Parallelization of Bulk Operations for STL Dictionaries
</i>. </span><span class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span>. </span><span class="author"><span class="firstname">Leonor</span> <span class="surname">Frias</span>. </span><span class="copyright">Copyright © 2007 . </span><span class="publisher"><span class="publishername"> </i>. </span><span class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span>. </span><span class="author"><span class="firstname">Leonor</span> <span class="surname">Frias</span>. </span><span class="copyright">Copyright © 2007 . </span><span class="publisher"><span class="publishername">
Workshop on Highly Parallel Processing on a Chip (HPPC) 2007. (LNCS) Workshop on Highly Parallel Processing on a Chip (HPPC) 2007. (LNCS)
. </span></span></p></div><div class="biblioentry"><a id="id660269"></a><p><span class="title"><i> . </span></span></p></div><div class="biblioentry" title="The Multi-Core Standard Template Library"><a id="id486148"></a><p><span class="title"><i>
The Multi-Core Standard Template Library The Multi-Core Standard Template Library
</i>. </span><span class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span>. </span><span class="author"><span class="firstname">Peter</span> <span class="surname">Sanders</span>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Putze</span>. </span><span class="copyright">Copyright © 2007 . </span><span class="publisher"><span class="publishername"> </i>. </span><span class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span>. </span><span class="author"><span class="firstname">Peter</span> <span class="surname">Sanders</span>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Putze</span>. </span><span class="copyright">Copyright © 2007 . </span><span class="publisher"><span class="publishername">
Euro-Par 2007: Parallel Processing. (LNCS 4641) Euro-Par 2007: Parallel Processing. (LNCS 4641)

Some files were not shown because too many files have changed in this diff Show More