re PR libstdc++/57226 (The installation of pretty printers is not documented)
PR libstdc++/57226 * doc/xml/manual/debug.xml (debug.gdb): Update documentation for installation and use of python printers. * doc/xml/manual/status_cxx2011.xml: Update. * doc/html/*: Regenerate. From-SVN: r207288
This commit is contained in:
parent
3100142a95
commit
1492a408f9
@ -41,6 +41,12 @@
|
||||
PR libstdc++/21609
|
||||
* include/ext/array_allocator.h: Add deprecated attribute.
|
||||
|
||||
PR libstdc++/57226
|
||||
* doc/xml/manual/debug.xml (debug.gdb): Update documentation for
|
||||
installation and use of python printers.
|
||||
* doc/xml/manual/status_cxx2011.xml: Update.
|
||||
* doc/html/*: Regenerate.
|
||||
|
||||
2014-01-28 Jonathan Wakely <jwakely@redhat.com>
|
||||
Kyle Lippincott <spectral@google.com>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
<a class="link" href="http://www.fsf.org/" target="_top">FSF
|
||||
</a>
|
||||
</p></div><div><div class="legalnotice"><a id="idm140623083743856"></a><p>
|
||||
</p></div><div><div class="legalnotice"><a id="idm234612107216"></a><p>
|
||||
<a class="link" href="manual/license.html" title="License">License
|
||||
</a>
|
||||
</p></div></div></div><hr /></div><p>
|
||||
|
@ -3,7 +3,7 @@
|
||||
2008, 2010
|
||||
|
||||
<a class="link" href="http://www.fsf.org" target="_top">FSF</a>
|
||||
</p></div></div><hr /></div><div class="qandaset"><a id="idm140623083442864"></a><dl><dt></dt><dd><dl><dt>1.1. <a href="faq.html#faq.what">
|
||||
</p></div></div><hr /></div><div class="qandaset"><a id="idm234616871040"></a><dl><dt></dt><dd><dl><dt>1.1. <a href="faq.html#faq.what">
|
||||
What is libstdc++?
|
||||
</a></dt><dt>1.2. <a href="faq.html#faq.why">
|
||||
Why should I use libstdc++?
|
||||
@ -296,7 +296,22 @@
|
||||
executable is run the linker finds and loads the required shared
|
||||
libraries by searching a pre-configured list of directories. If
|
||||
the directory where you've installed libstdc++ is not in this list
|
||||
then the libraries won't be found. The simplest way to fix this is
|
||||
then the libraries won't be found.
|
||||
</p><p>
|
||||
If you already have an older version of libstdc++ installed then the
|
||||
error might look like one of the following instead:
|
||||
</p><pre class="screen">
|
||||
./a.out: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.20' not found
|
||||
./a.out: /usr/lib/libstdc++.so.6: version `CXXABI_1.3.8' not found
|
||||
</pre><p>
|
||||
This means the linker found <code class="filename">/usr/lib/libstdc++.so.6</code>
|
||||
but that library belongs to an older version of GCC than was used to
|
||||
compile and link the program <code class="filename">a.out</code> (or some part
|
||||
of it). The program depends on code defined in the newer libstdc++
|
||||
that belongs to the newer version of GCC, so the linker must be told
|
||||
how to find the newer libstdc++ shared library.
|
||||
</p><p>
|
||||
The simplest way to fix this is
|
||||
to use the <code class="literal">LD_LIBRARY_PATH</code> environment variable,
|
||||
which is a colon-separated list of directories in which the linker
|
||||
will search for shared libraries:
|
||||
@ -304,6 +319,11 @@
|
||||
LD_LIBRARY_PATH=${prefix}/lib:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH
|
||||
</pre><p>
|
||||
Here the shell variable <span class="command"><strong>${prefix}</strong></span> is assumed to contain
|
||||
the directory prefix where GCC was installed to. The directory containing
|
||||
the library might depend on whether you want the 32-bit or 64-bit copy
|
||||
of the library, so for example would be
|
||||
<code class="filename">${prefix}/lib64</code> on some systems.
|
||||
The exact environment variable to use will depend on your
|
||||
platform, e.g. DYLD_LIBRARY_PATH for Darwin,
|
||||
LD_LIBRARY_PATH_32/LD_LIBRARY_PATH_64 for Solaris 32-/64-bit
|
||||
@ -312,7 +332,8 @@
|
||||
See the man pages for <span class="command"><strong>ld</strong></span>, <span class="command"><strong>ldd</strong></span>
|
||||
and <span class="command"><strong>ldconfig</strong></span> for more information. The dynamic
|
||||
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</code>,
|
||||
<code class="filename">rtld</code> or <code class="filename">dld.so</code>.
|
||||
</p><p>
|
||||
Using LD_LIBRARY_PATH is not always the best solution, <a class="link" href="manual/using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic" title="Finding Dynamic or Shared Libraries">Finding Dynamic or Shared
|
||||
Libraries</a> in the manual gives some alternatives.
|
||||
@ -511,6 +532,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.tr1" title="C++ TR1">TR1</a>, and
|
||||
<a class="link" href="manual/status.html#status.iso.2011" title="C++ 2011">C++11</a>.
|
||||
<a class="link" href="manual/status.html#status.iso.2014" title="C++ 2014">C++14</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><strong>5.2.</strong></p></td><td align="left" valign="top"><p>
|
||||
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>
|
||||
|
File diff suppressed because one or more lines are too long
@ -96,7 +96,7 @@ compatible.
|
||||
definitions, where the version definition is the maximum for a
|
||||
particular release. Labels are cumulative. If a particular release
|
||||
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 class="itemizedlist" style="list-style-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><li class="listitem"><p>GCC 4.5.0: GCC_4.5.0</p></li><li class="listitem"><p>GCC 4.6.0: GCC_4.6.0</p></li><li class="listitem"><p>GCC 4.7.0: GCC_4.7.0</p></li></ul></div></li><li class="listitem"><p>
|
||||
release.</p><p>This corresponds to the mapfile: gcc/libgcc-std.ver</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-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><li class="listitem"><p>GCC 4.5.0: GCC_4.5.0</p></li><li class="listitem"><p>GCC 4.6.0: GCC_4.6.0</p></li><li class="listitem"><p>GCC 4.7.0: GCC_4.7.0</p></li><li class="listitem"><p>GCC 4.8.0: GCC_4.8.0</p></li></ul></div></li><li class="listitem"><p>
|
||||
Release versioning on the libstdc++.so binary, implemented in
|
||||
the same way as the libgcc_s.so binary above. Listed is the
|
||||
filename: <code class="constant">DT_SONAME</code> can be deduced from
|
||||
@ -111,7 +111,7 @@ compatible.
|
||||
has the same filename and <code class="constant">DT_SONAME</code> as the
|
||||
preceding release.
|
||||
</p><p>It is versioned as follows:
|
||||
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-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.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 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.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.3.0: 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><li class="listitem"><p>GCC 4.6.0: libstdc++.so.6.0.15</p></li><li class="listitem"><p>GCC 4.6.1: libstdc++.so.6.0.16</p></li><li class="listitem"><p>GCC 4.7.0: libstdc++.so.6.0.17</p></li><li class="listitem"><p>GCC 4.8.0: libstdc++.so.6.0.18</p></li></ul></div><p>
|
||||
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-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.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 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.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.3.0: 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><li class="listitem"><p>GCC 4.6.0: libstdc++.so.6.0.15</p></li><li class="listitem"><p>GCC 4.6.1: libstdc++.so.6.0.16</p></li><li class="listitem"><p>GCC 4.7.0: libstdc++.so.6.0.17</p></li><li class="listitem"><p>GCC 4.8.0: libstdc++.so.6.0.18</p></li><li class="listitem"><p>GCC 4.8.3: libstdc++.so.6.0.19</p></li><li class="listitem"><p>GCC 4.9.0: libstdc++.so.6.0.20</p></li></ul></div><p>
|
||||
Note 1: Error should be libstdc++.so.3.0.3.
|
||||
</p><p>
|
||||
Note 2: Not strictly required.
|
||||
@ -129,7 +129,7 @@ compatible.
|
||||
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
|
||||
version labels as the preceding release.
|
||||
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-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><li class="listitem"><p>GCC 4.6.0: GLIBCXX_3.4.15, CXXABI_1.3.5</p></li><li class="listitem"><p>GCC 4.6.1: GLIBCXX_3.4.16, CXXABI_1.3.5</p></li><li class="listitem"><p>GCC 4.7.0: GLIBCXX_3.4.17, CXXABI_1.3.6</p></li><li class="listitem"><p>GCC 4.8.0: GLIBCXX_3.4.18, CXXABI_1.3.7</p></li></ul></div></li><li class="listitem"><p>Incremental bumping of a compiler pre-defined macro,
|
||||
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-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><li class="listitem"><p>GCC 4.6.0: GLIBCXX_3.4.15, CXXABI_1.3.5</p></li><li class="listitem"><p>GCC 4.6.1: GLIBCXX_3.4.16, CXXABI_1.3.5</p></li><li class="listitem"><p>GCC 4.7.0: GLIBCXX_3.4.17, CXXABI_1.3.6</p></li><li class="listitem"><p>GCC 4.8.0: GLIBCXX_3.4.18, CXXABI_1.3.7</p></li><li class="listitem"><p>GCC 4.8.3: GLIBCXX_3.4.19, CXXABI_1.3.7</p></li><li class="listitem"><p>GCC 4.9.0: GLIBCXX_3.4.20, CXXABI_1.3.8</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
|
||||
compiler v3 ABI, with g++ 3.0 being version 100. This macro will
|
||||
be automatically defined whenever g++ is used (the curious can
|
||||
@ -493,39 +493,39 @@ gcc test.c -g -O2 -L. -lone -ltwo /usr/lib/libstdc++.so.5 /usr/lib/libstdc++.so.
|
||||
<a class="link" href="http://www.codesourcery.com/cxx-abi/" target="_top">
|
||||
C++ ABI Summary
|
||||
</a>
|
||||
</em>. </span></p></div><div class="biblioentry"><a id="idm140623063941744"></a><p><span class="title"><em>
|
||||
</em>. </span></p></div><div class="biblioentry"><a id="idm234595922544"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.intel.com/cd/software/products/asmo-na/eng/284736.htm" target="_top">
|
||||
Intel Compilers for Linux Compatibility with the GNU Compilers
|
||||
</a>
|
||||
</em>. </span></p></div><div class="biblioentry"><a id="idm140623063939888"></a><p><span class="title"><em>
|
||||
</em>. </span></p></div><div class="biblioentry"><a id="idm234595920688"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://download.oracle.com/docs/cd/E19963-01/html/819-0690/index.html" target="_top">
|
||||
Linker and Libraries Guide (document 819-0690)
|
||||
</a>
|
||||
</em>. </span></p></div><div class="biblioentry"><a id="idm140623063938048"></a><p><span class="title"><em>
|
||||
</em>. </span></p></div><div class="biblioentry"><a id="idm234595918848"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://download.oracle.com/docs/cd/E19422-01/819-3689/index.html" target="_top">
|
||||
Sun Studio 11: C++ Migration Guide (document 819-3689)
|
||||
</a>
|
||||
</em>. </span></p></div><div class="biblioentry"><a id="idm140623063936192"></a><p><span class="title"><em>
|
||||
</em>. </span></p></div><div class="biblioentry"><a id="idm234595916992"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.akkadia.org/drepper/dsohowto.pdf" target="_top">
|
||||
How to Write Shared Libraries
|
||||
</a>
|
||||
</em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span></p></div><div class="biblioentry"><a id="idm140623063932752"></a><p><span class="title"><em>
|
||||
</em>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span></p></div><div class="biblioentry"><a id="idm234595913552"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.arm.com/miscPDFs/8033.pdf" target="_top">
|
||||
C++ ABI for the ARM Architecture
|
||||
</a>
|
||||
</em>. </span></p></div><div class="biblioentry"><a id="idm140623063930944"></a><p><span class="title"><em>
|
||||
</em>. </span></p></div><div class="biblioentry"><a id="idm234595911744"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1976.html" target="_top">
|
||||
Dynamic Shared Objects: Survey and Issues
|
||||
</a>
|
||||
</em>. </span><span class="subtitle">
|
||||
ISO C++ J16/06-0046
|
||||
. </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry"><a id="idm140623063927648"></a><p><span class="title"><em>
|
||||
. </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry"><a id="idm234595908448"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2013.html" target="_top">
|
||||
Versioning With Namespaces
|
||||
</a>
|
||||
</em>. </span><span class="subtitle">
|
||||
ISO C++ J16/06-0083
|
||||
. </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry"><a id="idm140623063924368"></a><p><span class="title"><em>
|
||||
. </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span></p></div><div class="biblioentry"><a id="idm234595905168"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://syrcose.ispras.ru/2009/files/SYRCoSE2009-CfP.pdf" target="_top">
|
||||
Binary Compatibility of Shared Libraries Implemented in C++
|
||||
on GNU/Linux Systems
|
||||
|
@ -6,7 +6,7 @@
|
||||
Standard Contents
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="numerics.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.algorithms"></a>Chapter 11.
|
||||
Algorithms
|
||||
<a id="idm140623070692736" class="indexterm"></a>
|
||||
<a id="idm234602676352" class="indexterm"></a>
|
||||
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="algorithms.html#std.algorithms.mutating">Mutating</a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt><dd><dl><dt><span class="section"><a href="algorithms.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></dd></dl></div><p>
|
||||
The neatest accomplishment of the algorithms section is that all the
|
||||
work is done via iterators, not containers directly. This means two
|
||||
|
@ -77,11 +77,11 @@ _Alloc_traits</code> have been removed.
|
||||
<span class="type">__alloc</span> to select an underlying allocator that
|
||||
satisfied memory allocation requests. The selection of this
|
||||
underlying allocator was not user-configurable.
|
||||
</p><div class="table"><a id="idm140623063857152"></a><p class="title"><strong>Table B.6. Extension Allocators</strong></p><div class="table-contents"><table summary="Extension Allocators" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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<T></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<T></code></td><td align="left"><code class="filename">ext/malloc_allocator.h</code></td><td align="left"><code class="classname">std::__malloc_alloc_template<int></code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::debug_allocator<T></code></td><td align="left"><code class="filename">ext/debug_allocator.h</code></td><td align="left"><code class="classname">std::debug_alloc<T></code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__pool_alloc<T></code></td><td align="left"><code class="filename">ext/pool_allocator.h</code></td><td align="left"><code class="classname">std::__default_alloc_template<bool,int></code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__mt_alloc<T></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<T></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="idm234595838080"></a><p class="title"><strong>Table B.6. Extension Allocators</strong></p><div class="table-contents"><table summary="Extension Allocators" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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<T></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<T></code></td><td align="left"><code class="filename">ext/malloc_allocator.h</code></td><td align="left"><code class="classname">std::__malloc_alloc_template<int></code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::debug_allocator<T></code></td><td align="left"><code class="filename">ext/debug_allocator.h</code></td><td align="left"><code class="classname">std::debug_alloc<T></code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__pool_alloc<T></code></td><td align="left"><code class="filename">ext/pool_allocator.h</code></td><td align="left"><code class="classname">std::__default_alloc_template<bool,int></code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__mt_alloc<T></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<T></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
|
||||
standard-style. The following table includes details, along with
|
||||
the first released version of GCC that included the extension allocator.
|
||||
</p><div class="table"><a id="idm140623063829520"></a><p class="title"><strong>Table B.7. Extension Allocators Continued</strong></p><div class="table-contents"><table summary="Extension Allocators Continued" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /></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<T></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<T></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="idm234595810448"></a><p class="title"><strong>Table B.7. Extension Allocators Continued</strong></p><div class="table-contents"><table summary="Extension Allocators Continued" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /></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<T></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<T></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.
|
||||
</p><p>
|
||||
Precompiled header support <acronym class="acronym">PCH</acronym> support.
|
||||
|
@ -6,7 +6,7 @@
|
||||
Appendices
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="source_organization.html">Next</a></td></tr></table><hr /></div><div class="appendix"><div class="titlepage"><div><div><h1 class="title"><a id="appendix.contrib"></a>
|
||||
Contributing
|
||||
<a id="idm140623065010896" class="indexterm"></a>
|
||||
<a id="idm234596994656" class="indexterm"></a>
|
||||
</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="section"><a href="appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="section"><a href="appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="section"><a href="source_organization.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="section"><a href="source_code_style.html">Coding Style</a></span></dt><dd><dl><dt><span class="section"><a href="source_code_style.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="section"><a href="source_code_style.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="section"><a href="source_design_notes.html">Design Notes</a></span></dt></dl></div><p>
|
||||
The GNU C++ Library is part of GCC and follows the same development model,
|
||||
so the general rules for
|
||||
|
@ -6,7 +6,7 @@
|
||||
Appendices
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="appendix_gpl.html">Next</a></td></tr></table><hr /></div><div class="appendix"><div class="titlepage"><div><div><h1 class="title"><a id="appendix.free"></a>
|
||||
Free Software Needs Free Documentation
|
||||
<a id="idm140623063461552" class="indexterm"></a>
|
||||
<a id="idm234595441264" class="indexterm"></a>
|
||||
</h1></div></div></div><p>
|
||||
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
|
||||
|
@ -77,7 +77,7 @@
|
||||
</p><p>
|
||||
The precise terms and conditions for copying, distribution and modification
|
||||
follow.
|
||||
</p><h2><a id="idm140623063421360"></a>
|
||||
</p><h2><a id="idm234595401136"></a>
|
||||
TERMS AND CONDITIONS
|
||||
</h2><h2><a id="gpl-3-definitions"></a>
|
||||
0. Definitions.
|
||||
@ -618,7 +618,7 @@
|
||||
waiver of all civil liability in connection with the Program, unless a
|
||||
warranty or assumption of liability accompanies a copy of the Program in
|
||||
return for a fee.
|
||||
</p><h2><a id="idm140623063322432"></a>
|
||||
</p><h2><a id="idm234595302208"></a>
|
||||
END OF TERMS AND CONDITIONS
|
||||
</h2><h2><a id="HowToApply"></a>
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
File diff suppressed because one or more lines are too long
@ -6,7 +6,7 @@
|
||||
Standard Contents
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="concurrency.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.atomics"></a>Chapter 14.
|
||||
Atomics
|
||||
<a id="idm140623070494192" class="indexterm"></a>
|
||||
<a id="idm234602478128" class="indexterm"></a>
|
||||
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="atomics.html#std.atomics.api">API Reference</a></span></dt></dl></div><p>
|
||||
Facilities for atomic operations.
|
||||
</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.atomics.api"></a>API Reference</h2></div></div></div><p>
|
||||
|
@ -512,16 +512,23 @@ AC_DEFUN([AC_HEADER_EXT_HASH_SET], [
|
||||
fi
|
||||
])
|
||||
</pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.third.nocreate_noreplace"></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
|
||||
input-streams has been confirmed, most probably because the author
|
||||
thought it would be more correct to specify nocreate explicitly. So
|
||||
it can be left out for input-streams.
|
||||
</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
|
||||
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,
|
||||
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> ?).
|
||||
</h4></div></div></div><p>Historically these flags were used with iostreams to control whether
|
||||
new files are created or not when opening a file stream, similar to the
|
||||
<code class="code">O_CREAT</code> and <code class="code">O_EXCL</code> flags for the
|
||||
<code class="function">open(2)</code> system call. Because iostream modes correspond
|
||||
to <code class="function">fopen(3)</code> modes these flags are not supported.
|
||||
For input streams a new file will not be created anyway, so
|
||||
<code class="code">ios::nocreate</code> is not needed.
|
||||
For output streams, a new file will be created if it does not exist, which is
|
||||
consistent with the behaviour of <code class="function">fopen</code>.
|
||||
</p><p>When one of these flags is needed a possible alternative is to attempt
|
||||
to open the file using <span class="type">std::ifstream</span> first to determine whether
|
||||
the file already exists or not. This may not be reliable however, because
|
||||
whether the file exists or not could change between opening the
|
||||
<span class="type">std::istream</span> and re-opening with an output stream. If you need
|
||||
to check for existence and open a file as a single operation then you will
|
||||
need to use OS-specific facilities outside the C++ standard library, such
|
||||
as <code class="function">open(2)</code>.
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="backwards.third.streamattach"></a>
|
||||
No <code class="code">stream::attach(int fd)</code>
|
||||
</h4></div></div></div><p>
|
||||
@ -940,15 +947,15 @@ AC_DEFUN([AC_HEADER_UNORDERED_SET], [
|
||||
This is a change in behavior from older versions. Now, most
|
||||
<span class="type">iterator_type</span> typedefs in container classes are POD
|
||||
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="idm140623063472640"></a><p><span class="title"><em>
|
||||
</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="idm234595452352"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.kegel.com/gcc/gcc4.html" target="_top">
|
||||
Migrating to GCC 4.1
|
||||
</a>
|
||||
</em>. </span><span class="author"><span class="firstname">Dan</span> <span class="surname">Kegel</span>. </span></p></div><div class="biblioentry"><a id="idm140623063469856"></a><p><span class="title"><em>
|
||||
</em>. </span><span class="author"><span class="firstname">Dan</span> <span class="surname">Kegel</span>. </span></p></div><div class="biblioentry"><a id="idm234595449568"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://lists.debian.org/debian-gcc/2006/03/msg00405.html" target="_top">
|
||||
Building the Whole Debian Archive with GCC 4.1: A Summary
|
||||
</a>
|
||||
</em>. </span><span class="author"><span class="firstname">Martin</span> <span class="surname">Michlmayr</span>. </span></p></div><div class="biblioentry"><a id="idm140623063467008"></a><p><span class="title"><em>
|
||||
</em>. </span><span class="author"><span class="firstname">Martin</span> <span class="surname">Michlmayr</span>. </span></p></div><div class="biblioentry"><a id="idm234595446720"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://annwm.lbl.gov/~leggett/Atlas/gcc-3.2.html" target="_top">
|
||||
Migration guide for GCC-3.2
|
||||
</a>
|
||||
|
@ -75,7 +75,7 @@ else return false.</p></li></ol></div><p>
|
||||
</p><p>
|
||||
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).
|
||||
</p><div class="table"><a id="idm140623069384160"></a><p class="title"><strong>Table 21.1. Bitmap Allocator Memory Map</strong></p><div class="table-contents"><table summary="Bitmap Allocator Memory Map" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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 -> Space for 64 ints</td></tr></tbody></table></div></div><br class="table-break" /><p>
|
||||
</p><div class="table"><a id="idm234601367712"></a><p class="title"><strong>Table 21.1. Bitmap Allocator Memory Map</strong></p><div class="table-contents"><table summary="Bitmap Allocator Memory Map" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /></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 -> 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
|
||||
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
|
||||
|
@ -338,9 +338,6 @@
|
||||
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#809" target="_top">809</a>:
|
||||
<span class="emphasis"><em>std::swap should be overloaded for array types</em></span>
|
||||
</span></dt><dd><p>Add the overload.
|
||||
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-defects.html#844" target="_top">844</a>:
|
||||
<span class="emphasis"><em>complex pow return type is ambiguous</em></span>
|
||||
</span></dt><dd><p>In C++11 mode, remove the pow(complex<T>, int) signature.
|
||||
</p></dd><dt><span class="term"><a class="link" 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></dt><dd><p>Update / add the signatures.
|
||||
|
@ -6,7 +6,7 @@
|
||||
Standard Contents
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="extensions.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.concurrency"></a>Chapter 15.
|
||||
Concurrency
|
||||
<a id="idm140623070480368" class="indexterm"></a>
|
||||
<a id="idm234602464368" class="indexterm"></a>
|
||||
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="concurrency.html#std.concurrency.api">API Reference</a></span></dt></dl></div><p>
|
||||
Facilities for concurrent operation, and control thereof.
|
||||
</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.concurrency.api"></a>API Reference</h2></div></div></div><p>
|
||||
|
@ -224,7 +224,14 @@
|
||||
to standard error for certain events such as calling a pure virtual
|
||||
function or the invocation of the standard terminate handler. Those
|
||||
messages cause the library to depend on the demangler and standard I/O
|
||||
facilites, which might be undesirable in a low-memory environment or
|
||||
facilities, which might be undesirable in a low-memory environment or
|
||||
when standard error is not available. This option disables those
|
||||
messages. This option does not change the library ABI.
|
||||
</p></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="setup.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="setup.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="make.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. Setup </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Make</td></tr></table></div></body></html>
|
||||
</p></dd><dt><span class="term"><code class="code">--enable-vtable-verify</code>[default]</span></dt><dd><p>Use <code class="code">-fvtable-verify=std</code> to compile the C++
|
||||
runtime with instrumentation for vtable verification. All virtual
|
||||
functions in the standard library will be verified at runtime.
|
||||
Types impacted include <code class="classname">locale</code> and
|
||||
<code class="classname">iostream</code>, and others. Disabling means that
|
||||
the C++ runtime is compiled without support for vtable
|
||||
verification. By default, this option is off.
|
||||
</p></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="setup.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="setup.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="make.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. Setup </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Make</td></tr></table></div></body></html>
|
@ -6,8 +6,8 @@
|
||||
Standard Contents
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="associative.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.containers"></a>Chapter 9.
|
||||
Containers
|
||||
<a id="idm140623070846688" class="indexterm"></a>
|
||||
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.containers.sequences"></a>Sequences</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="containers.sequences.list"></a>list</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="sequences.list.size"></a>list::size() is O(n)</h4></div></div></div><p>
|
||||
<a id="idm234602840144" class="indexterm"></a>
|
||||
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.containers.sequences"></a>Sequences</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="containers.sequences.list"></a>list</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="sequences.list.size"></a>list::size() is O(n)</h4></div></div></div><p>
|
||||
Yes it is, and that's okay. This is a decision that we preserved
|
||||
when we imported SGI's STL implementation. The following is
|
||||
quoted from <a class="link" href="http://www.sgi.com/tech/stl/FAQ.html" target="_top">their FAQ</a>:
|
||||
|
@ -178,8 +178,8 @@
|
||||
recommended: the other parts of this manual.
|
||||
</p><p>
|
||||
These settings can either be switched on in at the GDB command line,
|
||||
or put into a .gdbint file to establish default debugging
|
||||
characteristics, like so:
|
||||
or put into a <code class="filename">.gdbinit</code> file to establish default
|
||||
debugging characteristics, like so:
|
||||
</p><pre class="programlisting">
|
||||
set print pretty on
|
||||
set print object on
|
||||
@ -189,32 +189,22 @@
|
||||
set demangle-style gnu-v3
|
||||
</pre><p>
|
||||
Starting with version 7.0, GDB includes support for writing
|
||||
pretty-printers in Python. Pretty printers for STL classes are
|
||||
distributed with GCC from version 4.5.0. The most recent version of
|
||||
these printers are always found in libstdc++ svn repository.
|
||||
To enable these printers, check-out the latest printers to a local
|
||||
directory:
|
||||
</p><pre class="programlisting">
|
||||
svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
|
||||
</pre><p>
|
||||
Next, add the following section to your ~/.gdbinit The path must
|
||||
match the location where the Python module above was checked-out.
|
||||
So if checked out to: /home/maude/gdb_printers/, the path would be as
|
||||
written in the example below.
|
||||
</p><pre class="programlisting">
|
||||
python
|
||||
import sys
|
||||
sys.path.insert(0, '/home/maude/gdb_printers/python')
|
||||
from libstdcxx.v6.printers import register_libstdcxx_printers
|
||||
register_libstdcxx_printers (None)
|
||||
end
|
||||
</pre><p>
|
||||
The path should be the only element that needs to be adjusted in the
|
||||
example. Once loaded, STL classes that the printers support
|
||||
pretty-printers in Python. Pretty printers for containers and other
|
||||
classes are distributed with GCC from version 4.5.0 and should be installed
|
||||
alongside the libstdc++ shared library files and found automatically by
|
||||
GDB.
|
||||
</p><p>
|
||||
Depending where libstdc++ is installed, GDB might refuse to auto-load
|
||||
the python printers and print a warning instead.
|
||||
If this happens the python printers can be enabled by following the
|
||||
instructions GDB gives for setting your <code class="code">auto-load safe-path</code>
|
||||
in your <code class="filename">.gdbinit</code> configuration file.
|
||||
</p><p>
|
||||
Once loaded, standard library classes that the printers support
|
||||
should print in a more human-readable format. To print the classes
|
||||
in the old style, use the /r (raw) switch in the print command
|
||||
(i.e., print /r foo). This will print the classes as if the Python
|
||||
pretty-printers were not loaded.
|
||||
in the old style, use the <strong class="userinput"><code>/r</code></strong> (raw) switch in the
|
||||
print command (i.e., <strong class="userinput"><code>print /r foo</code></strong>). This will
|
||||
print the classes as if the Python pretty-printers were not loaded.
|
||||
</p><p>
|
||||
For additional information on STL support and GDB please visit:
|
||||
<a class="link" href="http://sourceware.org/gdb/wiki/STLSupport" target="_top"> "GDB Support
|
||||
@ -227,14 +217,13 @@
|
||||
</p></div><div class="section"><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="termination.html#support.termination.verbose" title="Verbose Terminate Handler">verbose
|
||||
termination handler</a> gives information about uncaught
|
||||
exceptions which are killing the program. It is described in the
|
||||
linked-to page.
|
||||
exceptions which kill the program.
|
||||
</p></div><div class="section"><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 17. Debug Mode">Debug Mode</a>
|
||||
has compile and run-time checks for many containers.
|
||||
</p></div><div class="section"><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 16. 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="section"><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 19. Profile Mode">Profile-based
|
||||
Performance Analysis</a> Extension has performance checks for many
|
||||
Performance Analysis</a> extension has performance checks for many
|
||||
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="std_contents.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Exceptions </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Part II.
|
||||
Standard Contents
|
||||
|
@ -18,6 +18,6 @@
|
||||
mode or with debug mode. The
|
||||
following table provides the names and headers of the debugging
|
||||
containers:
|
||||
</p><div class="table"><a id="idm140623070394448"></a><p class="title"><strong>Table 17.1. Debugging Containers</strong></p><div class="table-contents"><table summary="Debugging Containers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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"><debug/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"><debug/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"><debug/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"><debug/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"><debug/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"><debug/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"><debug/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"><debug/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"><debug/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"><debug/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"><debug/vector></code></td></tr></tbody></table></div></div><br class="table-break" /><p>In addition, when compiling in C++11 mode, these additional
|
||||
</p><div class="table"><a id="idm234602378400"></a><p class="title"><strong>Table 17.1. Debugging Containers</strong></p><div class="table-contents"><table summary="Debugging Containers" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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"><debug/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"><debug/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"><debug/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"><debug/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"><debug/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"><debug/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"><debug/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"><debug/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"><debug/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"><debug/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"><debug/vector></code></td></tr></tbody></table></div></div><br class="table-break" /><p>In addition, when compiling in C++11 mode, these additional
|
||||
containers have additional debug capability.
|
||||
</p><div class="table"><a id="idm140623070349552"></a><p class="title"><strong>Table 17.2. Debugging Containers C++11</strong></p><div class="table-contents"><table summary="Debugging Containers C++11" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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"><debug/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"><debug/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"><debug/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"><debug/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="debug_mode_semantics.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="debug_mode_design.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>
|
||||
</p><div class="table"><a id="idm234602333504"></a><p class="title"><strong>Table 17.2. Debugging Containers C++11</strong></p><div class="table-contents"><table summary="Debugging Containers C++11" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /></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"><debug/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"><debug/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"><debug/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"><debug/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="debug_mode_semantics.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="debug_mode_design.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>
|
@ -6,7 +6,7 @@
|
||||
Standard Contents
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="concept_checking.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.diagnostics"></a>Chapter 5.
|
||||
Diagnostics
|
||||
<a id="idm140623073051232" class="indexterm"></a>
|
||||
<a id="idm234605070960" class="indexterm"></a>
|
||||
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="concept_checking.html">Concept Checking</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.diagnostics.exceptions"></a>Exceptions</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="std.diagnostics.exceptions.api"></a>API Reference</h3></div></div></div><p>
|
||||
All exception objects are defined in one of the standard header
|
||||
files: <code class="filename">exception</code>,
|
||||
|
@ -112,7 +112,7 @@
|
||||
supported, and are always aliased to dummy rules. These
|
||||
unsupported formats are: <span class="emphasis"><em>info</em></span>,
|
||||
<span class="emphasis"><em>ps</em></span>, and <span class="emphasis"><em>dvi</em></span>.
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="doc.doxygen"></a>Doxygen</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.prereq"></a>Prerequisites</h4></div></div></div><div class="table"><a id="idm140623064725264"></a><p class="title"><strong>Table B.1. Doxygen Prerequisites</strong></p><div class="table-contents"><table summary="Doxygen Prerequisites" border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /></colgroup><thead><tr><th align="center">Tool</th><th align="center">Version</th><th align="center">Required By</th></tr></thead><tbody><tr><td align="center">coreutils</td><td align="center">8.5</td><td align="center">all</td></tr><tr><td align="center">bash</td><td align="center">4.1</td><td align="center">all</td></tr><tr><td align="center">doxygen</td><td align="center">1.7.6.1</td><td align="center">all</td></tr><tr><td align="center">graphviz</td><td align="center">2.26</td><td align="center">graphical hierarchies</td></tr><tr><td align="center">pdflatex</td><td align="center">2007-59</td><td align="center">pdf output</td></tr></tbody></table></div></div><br class="table-break" /><p>
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="doc.doxygen"></a>Doxygen</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="doxygen.prereq"></a>Prerequisites</h4></div></div></div><div class="table"><a id="idm234596709072"></a><p class="title"><strong>Table B.1. Doxygen Prerequisites</strong></p><div class="table-contents"><table summary="Doxygen Prerequisites" border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /></colgroup><thead><tr><th align="center">Tool</th><th align="center">Version</th><th align="center">Required By</th></tr></thead><tbody><tr><td align="center">coreutils</td><td align="center">8.5</td><td align="center">all</td></tr><tr><td align="center">bash</td><td align="center">4.1</td><td align="center">all</td></tr><tr><td align="center">doxygen</td><td align="center">1.7.6.1</td><td align="center">all</td></tr><tr><td align="center">graphviz</td><td align="center">2.26</td><td align="center">graphical hierarchies</td></tr><tr><td align="center">pdflatex</td><td align="center">2007-59</td><td align="center">pdf output</td></tr></tbody></table></div></div><br class="table-break" /><p>
|
||||
Prerequisite tools are Bash 2.0 or later,
|
||||
<a class="link" href="http://www.doxygen.org/" target="_top">Doxygen</a>, and
|
||||
the <a class="link" href="http://www.gnu.org/software/coreutils/" target="_top">GNU
|
||||
@ -309,7 +309,7 @@
|
||||
writing Doxygen comments. Single and double quotes, and
|
||||
separators in filenames are two common trouble spots. When in
|
||||
doubt, consult the following table.
|
||||
</p><div class="table"><a id="idm140623064649584"></a><p class="title"><strong>Table B.2. HTML to Doxygen Markup Comparison</strong></p><div class="table-contents"><table summary="HTML to Doxygen Markup Comparison" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">HTML</th><th align="left">Doxygen</th></tr></thead><tbody><tr><td align="left">\</td><td align="left">\\</td></tr><tr><td align="left">"</td><td align="left">\"</td></tr><tr><td align="left">'</td><td align="left">\'</td></tr><tr><td align="left"><i></td><td align="left">@a word</td></tr><tr><td align="left"><b></td><td align="left">@b word</td></tr><tr><td align="left"><code></td><td align="left">@c word</td></tr><tr><td align="left"><em></td><td align="left">@a word</td></tr><tr><td align="left"><em></td><td align="left"><em>two words or more</em></td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="doc.docbook"></a>Docbook</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.prereq"></a>Prerequisites</h4></div></div></div><div class="table"><a id="idm140623064630144"></a><p class="title"><strong>Table B.3. Docbook Prerequisites</strong></p><div class="table-contents"><table summary="Docbook Prerequisites" border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /></colgroup><thead><tr><th align="center">Tool</th><th align="center">Version</th><th align="center">Required By</th></tr></thead><tbody><tr><td align="center">docbook5-style-xsl</td><td align="center">1.76.1</td><td align="center">all</td></tr><tr><td align="center">xsltproc</td><td align="center">1.1.26</td><td align="center">all</td></tr><tr><td align="center">xmllint</td><td align="center">2.7.7</td><td align="center">validation</td></tr><tr><td align="center">dblatex</td><td align="center">0.3</td><td align="center">pdf output</td></tr><tr><td align="center">pdflatex</td><td align="center">2007-59</td><td align="center">pdf output</td></tr><tr><td align="center">docbook2X</td><td align="center">0.8.8</td><td align="center">info output</td></tr><tr><td align="center">epub3 stylesheets</td><td align="center">b3</td><td align="center">epub output</td></tr></tbody></table></div></div><br class="table-break" /><p>
|
||||
</p><div class="table"><a id="idm234596633392"></a><p class="title"><strong>Table B.2. HTML to Doxygen Markup Comparison</strong></p><div class="table-contents"><table summary="HTML to Doxygen Markup Comparison" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">HTML</th><th align="left">Doxygen</th></tr></thead><tbody><tr><td align="left">\</td><td align="left">\\</td></tr><tr><td align="left">"</td><td align="left">\"</td></tr><tr><td align="left">'</td><td align="left">\'</td></tr><tr><td align="left"><i></td><td align="left">@a word</td></tr><tr><td align="left"><b></td><td align="left">@b word</td></tr><tr><td align="left"><code></td><td align="left">@c word</td></tr><tr><td align="left"><em></td><td align="left">@a word</td></tr><tr><td align="left"><em></td><td align="left"><em>two words or more</em></td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="doc.docbook"></a>Docbook</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="docbook.prereq"></a>Prerequisites</h4></div></div></div><div class="table"><a id="idm234596613952"></a><p class="title"><strong>Table B.3. Docbook Prerequisites</strong></p><div class="table-contents"><table summary="Docbook Prerequisites" border="1"><colgroup><col align="center" class="c1" /><col align="center" class="c2" /><col align="center" class="c3" /></colgroup><thead><tr><th align="center">Tool</th><th align="center">Version</th><th align="center">Required By</th></tr></thead><tbody><tr><td align="center">docbook5-style-xsl</td><td align="center">1.76.1</td><td align="center">all</td></tr><tr><td align="center">xsltproc</td><td align="center">1.1.26</td><td align="center">all</td></tr><tr><td align="center">xmllint</td><td align="center">2.7.7</td><td align="center">validation</td></tr><tr><td align="center">dblatex</td><td align="center">0.3</td><td align="center">pdf output</td></tr><tr><td align="center">pdflatex</td><td align="center">2007-59</td><td align="center">pdf output</td></tr><tr><td align="center">docbook2X</td><td align="center">0.8.8</td><td align="center">info output</td></tr><tr><td align="center">epub3 stylesheets</td><td align="center">b3</td><td align="center">epub output</td></tr></tbody></table></div></div><br class="table-break" /><p>
|
||||
Editing the DocBook sources requires an XML editor. Many
|
||||
exist: some notable options
|
||||
include <span class="command"><strong>emacs</strong></span>, <span class="application">Kate</span>,
|
||||
@ -519,11 +519,11 @@ make <code class="literal">XSL_STYLE_DIR="/usr/share/xml/docbook/stylesheet/nwal
|
||||
<a class="link" 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 table below.
|
||||
</p><div class="table"><a id="idm140623064552576"></a><p class="title"><strong>Table B.4. HTML to Docbook XML Markup Comparison</strong></p><div class="table-contents"><table summary="HTML to Docbook XML Markup Comparison" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">HTML</th><th align="left">Docbook</th></tr></thead><tbody><tr><td align="left"><p></td><td align="left"><para></td></tr><tr><td align="left"><pre></td><td align="left"><computeroutput>, <programlisting>,
|
||||
</p><div class="table"><a id="idm234596536320"></a><p class="title"><strong>Table B.4. HTML to Docbook XML Markup Comparison</strong></p><div class="table-contents"><table summary="HTML to Docbook XML Markup Comparison" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">HTML</th><th align="left">Docbook</th></tr></thead><tbody><tr><td align="left"><p></td><td align="left"><para></td></tr><tr><td align="left"><pre></td><td align="left"><computeroutput>, <programlisting>,
|
||||
<literallayout></td></tr><tr><td align="left"><ul></td><td align="left"><itemizedlist></td></tr><tr><td align="left"><ol></td><td align="left"><orderedlist></td></tr><tr><td align="left"><il></td><td align="left"><listitem></td></tr><tr><td align="left"><dl></td><td align="left"><variablelist></td></tr><tr><td align="left"><dt></td><td align="left"><term></td></tr><tr><td align="left"><dd></td><td align="left"><listitem></td></tr><tr><td align="left"><a href=""></td><td align="left"><ulink url=""></td></tr><tr><td align="left"><code></td><td align="left"><literal>, <programlisting></td></tr><tr><td align="left"><strong></td><td align="left"><emphasis></td></tr><tr><td align="left"><em></td><td align="left"><emphasis></td></tr><tr><td align="left">"</td><td align="left"><quote></td></tr></tbody></table></div></div><br class="table-break" /><p>
|
||||
And examples of detailed markup for which there are no real HTML
|
||||
equivalents are listed in the table below.
|
||||
</p><div class="table"><a id="idm140623064528432"></a><p class="title"><strong>Table B.5. Docbook XML Element Use</strong></p><div class="table-contents"><table summary="Docbook XML Element Use" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Element</th><th align="left">Use</th></tr></thead><tbody><tr><td align="left"><structname></td><td align="left"><structname>char_traits</structname></td></tr><tr><td align="left"><classname></td><td align="left"><classname>string</classname></td></tr><tr><td align="left"><function></td><td align="left">
|
||||
</p><div class="table"><a id="idm234596512176"></a><p class="title"><strong>Table B.5. Docbook XML Element Use</strong></p><div class="table-contents"><table summary="Docbook XML Element Use" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Element</th><th align="left">Use</th></tr></thead><tbody><tr><td align="left"><structname></td><td align="left"><structname>char_traits</structname></td></tr><tr><td align="left"><classname></td><td align="left"><classname>string</classname></td></tr><tr><td align="left"><function></td><td align="left">
|
||||
<p><function>clear()</function></p>
|
||||
<p><function>fs.clear()</function></p>
|
||||
</td></tr><tr><td align="left"><type></td><td align="left"><type>long long</type></td></tr><tr><td align="left"><varname></td><td align="left"><varname>fs</varname></td></tr><tr><td align="left"><literal></td><td align="left">
|
||||
|
@ -32,8 +32,9 @@
|
||||
<code class="code">#define _GLIBCXX_CONCEPT_CHECKS</code> for GCC 3.4 and higher
|
||||
(or with <code class="code">#define _GLIBCPP_CONCEPT_CHECKS</code> for versions
|
||||
3.1, 3.2 and 3.3).
|
||||
</p><p>Please note that the upcoming C++ standard has first-class
|
||||
</p><p>Please note that the concept checks only validate the requirements
|
||||
of the old C++03 standard. C++11 was expected to have first-class
|
||||
support for template parameter constraints based on concepts in the core
|
||||
language. This will obviate the need for the library-simulated concept
|
||||
checking described above.
|
||||
language. This would have obviated the need for the library-simulated concept
|
||||
checking described above, but was not part of C++11.
|
||||
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_preface.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="debug_mode.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 17. Debug Mode</td></tr></table></div></body></html>
|
@ -2,7 +2,7 @@
|
||||
<!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-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="extensions.html" title="Part III. Extensions" /><link rel="prev" href="extensions.html" title="Part III. Extensions" /><link rel="next" href="ext_compile_checks.html" title="Chapter 16. 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 III.
|
||||
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"><div class="titlepage"><div><div><h1 class="title"><a id="idm140623070458848"></a></h1></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><h1 class="title"><a id="idm234602442848"></a></h1></div></div></div><p>
|
||||
Here we will make an attempt at describing the non-Standard
|
||||
extensions to the library. Some of these are from older versions of
|
||||
standard library components, namely SGI's STL, and some of these are
|
||||
|
File diff suppressed because one or more lines are too long
@ -2,11 +2,11 @@
|
||||
<!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>Facets</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="localization.html" title="Chapter 8. Localization" /><link rel="prev" href="localization.html" title="Chapter 8. Localization" /><link rel="next" href="containers.html" title="Chapter 9. Containers" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Facets</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="localization.html">Prev</a> </td><th width="60%" align="center">Chapter 8.
|
||||
Localization
|
||||
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="containers.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.localization.facet"></a>Facets</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.facet.ctype"></a>ctype</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.impl"></a>Implementation</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623071106352"></a>Specializations</h5></div></div></div><p>
|
||||
For the required specialization codecvt<wchar_t, char, mbstate_t> ,
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="containers.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.localization.facet"></a>Facets</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.facet.ctype"></a>ctype</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.impl"></a>Implementation</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm234603126096"></a>Specializations</h5></div></div></div><p>
|
||||
For the required specialization <code class="classname">codecvt<wchar_t, char, mbstate_t></code>,
|
||||
conversions are made between the internal character set (always UCS4
|
||||
on GNU/Linux) and whatever the currently selected locale for the
|
||||
LC_CTYPE category implements.
|
||||
<code class="code">LC_CTYPE</code> category implements.
|
||||
</p><p>
|
||||
The two required specializations are implemented as follows:
|
||||
</p><p>
|
||||
@ -22,19 +22,22 @@ ctype<wchar_t>
|
||||
</p><p>
|
||||
This specialization, by specifying all the template parameters, pretty
|
||||
much ties the hands of implementors. As such, the implementation is
|
||||
straightforward, involving mcsrtombs for the conversions between char
|
||||
to wchar_t and wcsrtombs for conversions between wchar_t and char.
|
||||
straightforward, involving <code class="function">mcsrtombs</code> for the
|
||||
conversions between <span class="type">char</span> to <span class="type">wchar_t</span> and
|
||||
<code class="function">wcsrtombs</code> for conversions between <span class="type">wchar_t</span>
|
||||
and <span class="type">char</span>.
|
||||
</p><p>
|
||||
Neither of these two required specializations deals with Unicode
|
||||
characters.
|
||||
</p></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.future"></a>Future</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
|
||||
How to deal with the global locale issue?
|
||||
</p></li><li class="listitem"><p>
|
||||
How to deal with different types than char, wchar_t? </p></li><li class="listitem"><p>
|
||||
How to deal with types other than <span class="type">char</span>, <span class="type">wchar_t</span>?
|
||||
</p></li><li class="listitem"><p>
|
||||
Overlap between codecvt/ctype: narrow/widen
|
||||
</p></li><li class="listitem"><p>
|
||||
Mask typedef in codecvt_base, argument types in codecvt. what
|
||||
is know about this type?
|
||||
<span class="type">mask</span> typedef in <code class="classname">codecvt_base</code>,
|
||||
argument types in <span class="type">codecvt</span>. what is know about this type?
|
||||
</p></li><li class="listitem"><p>
|
||||
Why mask* argument in codecvt?
|
||||
</p></li><li class="listitem"><p>
|
||||
@ -42,31 +45,32 @@ characters.
|
||||
straighten out the configure-time mess that is a by-product of
|
||||
this class?
|
||||
</p></li><li class="listitem"><p>
|
||||
Get the ctype<wchar_t>::mask stuff under control. Need to
|
||||
make some kind of static table, and not do lookup every time
|
||||
somebody hits the do_is... functions. Too bad we can't just
|
||||
redefine mask for ctype<wchar_t>
|
||||
Get the <span class="type">ctype<wchar_t>::mask</span> stuff under control.
|
||||
Need to make some kind of static table, and not do lookup every time
|
||||
somebody hits the <code class="code">do_is...</code> functions. Too bad we can't
|
||||
just redefine <span class="type">mask</span> for
|
||||
<code class="classname">ctype<wchar_t></code>
|
||||
</p></li><li class="listitem"><p>
|
||||
Rename abstract base class. See if just smash-overriding is a
|
||||
better approach. Clarify, add sanity to naming.
|
||||
</p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm140623071091296"></a><p><span class="citetitle"><em class="citetitle">
|
||||
</p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.ctype.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm234603103680"></a><p><span class="citetitle"><em class="citetitle">
|
||||
The GNU C Library
|
||||
</em>. </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="idm140623071086544"></a><p><span class="citetitle"><em class="citetitle">
|
||||
</em>. </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="idm234603098928"></a><p><span class="citetitle"><em class="citetitle">
|
||||
Correspondence
|
||||
</em>. </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="idm140623071083456"></a><p><span class="citetitle"><em class="citetitle">
|
||||
</em>. </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="idm234603095840"></a><p><span class="citetitle"><em class="citetitle">
|
||||
ISO/IEC 14882:1998 Programming languages - C++
|
||||
</em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="idm140623071081168"></a><p><span class="citetitle"><em class="citetitle">
|
||||
</em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="idm234603093552"></a><p><span class="citetitle"><em class="citetitle">
|
||||
ISO/IEC 9899:1999 Programming languages - C
|
||||
</em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="idm140623071078896"></a><p><span class="title"><em>
|
||||
</em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="idm234603091280"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.unix.org/version3/ieee_std.html" target="_top">
|
||||
The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
|
||||
</a>
|
||||
</em>. </span><span class="copyright">Copyright © 1999
|
||||
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span></p></div><div class="biblioentry"><a id="idm140623071075648"></a><p><span class="citetitle"><em class="citetitle">
|
||||
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span></p></div><div class="biblioentry"><a id="idm234603088032"></a><p><span class="citetitle"><em class="citetitle">
|
||||
The C++ Programming Language, Special Edition
|
||||
</em>. </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
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm140623071071024"></a><p><span class="citetitle"><em class="citetitle">
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm234603083408"></a><p><span class="citetitle"><em class="citetitle">
|
||||
Standard C++ IOStreams and Locales
|
||||
</em>. </span><span class="subtitle">
|
||||
Advanced Programmer's Guide and Reference
|
||||
@ -76,11 +80,11 @@ characters.
|
||||
The standard class codecvt attempts to address conversions between
|
||||
different character encoding schemes. In particular, the standard
|
||||
attempts to detail conversions between the implementation-defined wide
|
||||
characters (hereafter referred to as wchar_t) and the standard type
|
||||
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
|
||||
how the GNU libstdc++ implementation deals with the conversion between
|
||||
wide and narrow characters, and also presents a framework for dealing
|
||||
characters (hereafter referred to as <span class="type">wchar_t</span>) and the standard
|
||||
type <span class="type">char</span> 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 how the GNU libstdc++ implementation deals with the conversion
|
||||
between wide and narrow characters, and also presents a framework for dealing
|
||||
with the huge number of other encodings that iconv can convert,
|
||||
including Unicode and UTF8. Design issues and requirements are
|
||||
addressed, and examples of correct usage for both the required
|
||||
@ -94,8 +98,8 @@ Around page 425 of the C++ Standard, this charming heading comes into view:
|
||||
The text around the codecvt definition gives some clues:
|
||||
</p><div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<span class="emphasis"><em>
|
||||
-1- The class codecvt<internT,externT,stateT> is for use when
|
||||
converting from one codeset to another, such as from wide characters
|
||||
-1- The class <code class="code">codecvt<internT,externT,stateT></code> is for use
|
||||
when converting from one codeset to another, such as from wide characters
|
||||
to multibyte characters, between wide character encodings such as
|
||||
Unicode and EUC.
|
||||
</em></span>
|
||||
@ -105,35 +109,38 @@ translations between other character sets should be handled by this
|
||||
class.
|
||||
</p><div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<span class="emphasis"><em>
|
||||
-2- The stateT argument selects the pair of codesets being mapped between.
|
||||
-2- The <span class="type">stateT</span> argument selects the pair of codesets being mapped between.
|
||||
</em></span>
|
||||
</p></blockquote></div><p>
|
||||
Ah ha! Another clue...
|
||||
</p><div class="blockquote"><blockquote class="blockquote"><p>
|
||||
<span class="emphasis"><em>
|
||||
-3- The instantiations required in the Table ??
|
||||
(lib.locale.category), namely codecvt<wchar_t,char,mbstate_t> and
|
||||
codecvt<char,char,mbstate_t>, convert the implementation-defined
|
||||
native character set. codecvt<char,char,mbstate_t> implements a
|
||||
degenerate conversion; it does not convert at
|
||||
all. codecvt<wchar_t,char,mbstate_t> converts between the native
|
||||
character sets for tiny and wide characters. Instantiations on
|
||||
mbstate_t perform conversion between encodings known to the library
|
||||
-3- The instantiations required in the Table 51 (lib.locale.category), namely
|
||||
<code class="classname">codecvt<wchar_t,char,mbstate_t></code> and
|
||||
<code class="classname">codecvt<char,char,mbstate_t></code>, convert the
|
||||
implementation-defined native character set.
|
||||
<code class="classname">codecvt<char,char,mbstate_t></code> implements a
|
||||
degenerate conversion; it does not convert at all.
|
||||
<code class="classname">codecvt<wchar_t,char,mbstate_t></code> converts between
|
||||
the native character sets for tiny and wide characters. Instantiations on
|
||||
<span class="type">mbstate_t</span> perform conversion between encodings known to the library
|
||||
implementor. Other encodings can be converted by specializing on a
|
||||
user-defined stateT type. The stateT object can contain any state that
|
||||
is useful to communicate to or from the specialized do_convert member.
|
||||
user-defined <span class="type">stateT</span> type. The <span class="type">stateT</span> object can
|
||||
contain any state that is useful to communicate to or from the specialized
|
||||
<code class="function">do_convert</code> member.
|
||||
</em></span>
|
||||
</p></blockquote></div><p>
|
||||
At this point, a couple points become clear:
|
||||
</p><p>
|
||||
One: The standard clearly implies that attempts to add non-required
|
||||
(yet useful and widely used) conversions need to do so through the
|
||||
third template parameter, stateT.</p><p>
|
||||
Two: The required conversions, by specifying mbstate_t as the third
|
||||
template parameter, imply an implementation strategy that is mostly
|
||||
third template parameter, <span class="type">stateT</span>.</p><p>
|
||||
Two: The required conversions, by specifying <span class="type">mbstate_t</span> as the
|
||||
third template parameter, imply an implementation strategy that is mostly
|
||||
(or wholly) based on the underlying C library, and the functions
|
||||
mcsrtombs and wcsrtombs in particular.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="facet.codecvt.design"></a>Design</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="codecvt.design.wchar_t_size"></a><span class="type">wchar_t</span> Size</h5></div></div></div><p>
|
||||
The simple implementation detail of wchar_t's size seems to
|
||||
<code class="function">mcsrtombs</code> and <code class="function">wcsrtombs</code> in
|
||||
particular.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="facet.codecvt.design"></a>Design</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="codecvt.design.wchar_t_size"></a><span class="type">wchar_t</span> Size</h5></div></div></div><p>
|
||||
The simple implementation detail of <span class="type">wchar_t</span>'s size seems to
|
||||
repeatedly confound people. Many systems use a two byte,
|
||||
unsigned integral type to represent wide characters, and use an
|
||||
internal encoding of Unicode or UCS2. (See AIX, Microsoft NT,
|
||||
@ -141,24 +148,27 @@ mcsrtombs and wcsrtombs in particular.</p></div><div class="section"><div class=
|
||||
type to represent wide characters, and use an internal encoding
|
||||
of UCS4. (GNU/Linux systems using glibc, in particular.) The C
|
||||
programming language (and thus C++) does not specify a specific
|
||||
size for the type wchar_t.
|
||||
size for the type <span class="type">wchar_t</span>.
|
||||
</p><p>
|
||||
Thus, portable C++ code cannot assume a byte size (or endianness) either.
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="codecvt.design.unicode"></a>Support for Unicode</h5></div></div></div><p>
|
||||
Probably the most frequently asked question about code conversion
|
||||
is: "So dudes, what's the deal with Unicode strings?"
|
||||
The dude part is optional, but apparently the usefulness of
|
||||
Unicode strings is pretty widely appreciated. Sadly, this specific
|
||||
encoding (And other useful encodings like UTF8, UCS4, ISO 8859-10,
|
||||
etc etc etc) are not mentioned in the C++ standard.
|
||||
Unicode strings is pretty widely appreciated. The Unicode character
|
||||
set (and useful encodings like UTF-8, UCS-4, ISO 8859-10,
|
||||
etc etc etc) were not mentioned in the first C++ standard. (The 2011
|
||||
standard added support for string literals with different encodings
|
||||
and some library facilities for converting between encodings, but the
|
||||
notes below have not been updated to reflect that.)
|
||||
</p><p>
|
||||
A couple of comments:
|
||||
</p><p>
|
||||
The thought that all one needs to convert between two arbitrary
|
||||
codesets is two types and some kind of state argument is
|
||||
unfortunate. In particular, encodings may be stateless. The naming
|
||||
of the third parameter as stateT is unfortunate, as what is really
|
||||
needed is some kind of generalized type that accounts for the
|
||||
of the third parameter as <span class="type">stateT</span> is unfortunate, as what is
|
||||
really needed is some kind of generalized type that accounts for the
|
||||
issues that abstract encodings will need. The minimum information
|
||||
that is required includes:
|
||||
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
|
||||
@ -215,12 +225,14 @@ mechanism may be required.
|
||||
</p></li></ul></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="codecvt.design.issues"></a>Other Issues</h5></div></div></div><p>
|
||||
In addition, multi-threaded and multi-locale environments also impact
|
||||
the design and requirements for code conversions. In particular, they
|
||||
affect the required specialization codecvt<wchar_t, char, mbstate_t>
|
||||
affect the required specialization
|
||||
<code class="classname">codecvt<wchar_t, char, mbstate_t></code>
|
||||
when implemented using standard "C" functions.
|
||||
</p><p>
|
||||
Three problems arise, one big, one of medium importance, and one small.
|
||||
</p><p>
|
||||
First, the small: mcsrtombs and wcsrtombs may not be multithread-safe
|
||||
First, the small: <code class="function">mcsrtombs</code> and
|
||||
<code class="function">wcsrtombs</code> may not be multithread-safe
|
||||
on all systems required by the GNU tools. For GNU/Linux and glibc,
|
||||
this is not an issue.
|
||||
</p><p>
|
||||
@ -240,7 +252,8 @@ multiple locales and or simultaneous usage with computationally
|
||||
correct results. In short, libstdc++ is trying to offer, as an
|
||||
option, a high-quality implementation, damn the additional complexity!
|
||||
</p><p>
|
||||
For the required specialization codecvt<wchar_t, char, mbstate_t> ,
|
||||
For the required specialization
|
||||
<code class="classname">codecvt<wchar_t, char, mbstate_t></code>,
|
||||
conversions are made between the internal character set (always UCS4
|
||||
on GNU/Linux) and whatever the currently selected locale for the
|
||||
LC_CTYPE category implements.
|
||||
@ -260,29 +273,31 @@ codecvt<char, wchar_t, mbstate_t>
|
||||
</p><p>
|
||||
This specialization, by specifying all the template parameters, pretty
|
||||
much ties the hands of implementors. As such, the implementation is
|
||||
straightforward, involving mcsrtombs for the conversions between char
|
||||
to wchar_t and wcsrtombs for conversions between wchar_t and char.
|
||||
straightforward, involving <code class="function">mcsrtombs</code> for the conversions
|
||||
between <span class="type">char</span> to <span class="type">wchar_t</span> and
|
||||
<code class="function">wcsrtombs</code> for conversions between <span class="type">wchar_t</span>
|
||||
and <span class="type">char</span>.
|
||||
</p><p>
|
||||
Neither of these two required specializations deals with Unicode
|
||||
characters. As such, libstdc++ implements a partial specialization
|
||||
of the codecvt class with and iconv wrapper class, encoding_state as the
|
||||
third template parameter.
|
||||
of the <span class="type">codecvt</span> class with an iconv wrapper class,
|
||||
<code class="classname">encoding_state</code> as the third template parameter.
|
||||
</p><p>
|
||||
This implementation should be standards conformant. First of all, the
|
||||
standard explicitly points out that instantiations on the third
|
||||
template parameter, stateT, are the proper way to implement
|
||||
template parameter, <span class="type">stateT</span>, are the proper way to implement
|
||||
non-required conversions. Second of all, the standard says (in Chapter
|
||||
17) that partial specializations of required classes are a-ok. Third
|
||||
of all, the requirements for the stateT type elsewhere in the standard
|
||||
(see 21.1.2 traits typedefs) only indicate that this type be copy
|
||||
17) that partial specializations of required classes are A-OK. Third
|
||||
of all, the requirements for the <span class="type">stateT</span> type elsewhere in the
|
||||
standard (see 21.1.2 traits typedefs) only indicate that this type be copy
|
||||
constructible.
|
||||
</p><p>
|
||||
As such, the type encoding_state is defined as a non-templatized, POD
|
||||
type to be used as the third type of a codecvt instantiation. This
|
||||
type is just a wrapper class for iconv, and provides an easy interface
|
||||
As such, the type <span class="type">encoding_state</span> is defined as a non-templatized,
|
||||
POD type to be used as the third type of a <span class="type">codecvt</span> instantiation.
|
||||
This type is just a wrapper class for iconv, and provides an easy interface
|
||||
to iconv functionality.
|
||||
</p><p>
|
||||
There are two constructors for encoding_state:
|
||||
There are two constructors for <span class="type">encoding_state</span>:
|
||||
</p><p>
|
||||
<code class="code">
|
||||
encoding_state() : __in_desc(0), __out_desc(0)
|
||||
@ -290,7 +305,7 @@ encoding_state() : __in_desc(0), __out_desc(0)
|
||||
</p><p>
|
||||
This default constructor sets the internal encoding to some default
|
||||
(currently UCS4) and the external encoding to whatever is returned by
|
||||
nl_langinfo(CODESET).
|
||||
<code class="code">nl_langinfo(CODESET)</code>.
|
||||
</p><p>
|
||||
<code class="code">
|
||||
encoding_state(const char* __int, const char* __ext)
|
||||
@ -302,7 +317,7 @@ either argument.
|
||||
</p><p>
|
||||
One of the issues with iconv is that the string literals identifying
|
||||
conversions are not standardized. Because of this, the thought of
|
||||
mandating and or enforcing some set of pre-determined valid
|
||||
mandating and/or enforcing some set of pre-determined valid
|
||||
identifiers seems iffy: thus, a more practical (and non-migraine
|
||||
inducing) strategy was implemented: end-users can specify any string
|
||||
(subject to a pre-determined length qualifier, currently 32 bytes) for
|
||||
@ -325,12 +340,12 @@ bool
|
||||
_M_good()
|
||||
</code>
|
||||
</p><p>
|
||||
Provides a way to see if the given encoding_state object has been
|
||||
Provides a way to see if the given <span class="type">encoding_state</span> object has been
|
||||
properly initialized. If the string literals describing the desired
|
||||
internal and external encoding are not valid, initialization will
|
||||
fail, and this will return false. If the internal and external
|
||||
encodings are valid, but iconv_open could not allocate conversion
|
||||
descriptors, this will also return false. Otherwise, the object is
|
||||
encodings are valid, but <code class="function">iconv_open</code> could not allocate
|
||||
conversion descriptors, this will also return false. Otherwise, the object is
|
||||
ready to convert and will return true.
|
||||
</p><p>
|
||||
<code class="code">
|
||||
@ -343,10 +358,10 @@ and external code conversions, and not the conversion descriptors
|
||||
themselves.
|
||||
</p><p>
|
||||
Definitions for all the required codecvt member functions are provided
|
||||
for this specialization, and usage of codecvt<internal character type,
|
||||
external character type, encoding_state> is consistent with other
|
||||
for this specialization, and usage of <code class="code">codecvt<<em class="replaceable"><code>internal
|
||||
character type</code></em>, <em class="replaceable"><code>external character type</code></em>, <em class="replaceable"><code>encoding_state</code></em>></code> is consistent with other
|
||||
codecvt usage.
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="facet.codecvt.use"></a>Use</h4></div></div></div><p>A conversions involving string literal.</p><pre class="programlisting">
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="facet.codecvt.use"></a>Use</h4></div></div></div><p>A conversion involving a string literal.</p><pre class="programlisting">
|
||||
typedef codecvt_base::result result;
|
||||
typedef unsigned short unicode_t;
|
||||
typedef unicode_t int_type;
|
||||
@ -389,7 +404,7 @@ codecvt usage.
|
||||
are only weakly implemented. I have no idea how to do
|
||||
this correctly, and in a generic manner. Nathan?
|
||||
</p></li><li class="listitem"><p>
|
||||
b. conversions involving std::string
|
||||
b. conversions involving <span class="type">std::string</span>
|
||||
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
|
||||
how should operators != and == work for string of
|
||||
different/same encoding?
|
||||
@ -409,42 +424,42 @@ codecvt usage.
|
||||
</p></li><li class="listitem"><p>
|
||||
wchar_t/char internal buffers and conversions between
|
||||
internal/external buffers?
|
||||
</p></li></ul></div></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.codecvt.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm140623070993488"></a><p><span class="citetitle"><em class="citetitle">
|
||||
</p></li></ul></div></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.codecvt.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm234602986688"></a><p><span class="citetitle"><em class="citetitle">
|
||||
The GNU C Library
|
||||
</em>. </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="idm140623070988736"></a><p><span class="citetitle"><em class="citetitle">
|
||||
. </span></p></div><div class="biblioentry"><a id="idm234602981936"></a><p><span class="citetitle"><em class="citetitle">
|
||||
Correspondence
|
||||
</em>. </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="idm140623070985648"></a><p><span class="citetitle"><em class="citetitle">
|
||||
</em>. </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="idm234602978848"></a><p><span class="citetitle"><em class="citetitle">
|
||||
ISO/IEC 14882:1998 Programming languages - C++
|
||||
</em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="idm140623070983360"></a><p><span class="citetitle"><em class="citetitle">
|
||||
</em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="idm234602976560"></a><p><span class="citetitle"><em class="citetitle">
|
||||
ISO/IEC 9899:1999 Programming languages - C
|
||||
</em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="idm140623070981088"></a><p><span class="title"><em>
|
||||
</em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="idm234602974288"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.opengroup.org/austin/" target="_top">
|
||||
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
|
||||
</a>
|
||||
</em>. </span><span class="copyright">Copyright © 2008
|
||||
The Open Group/The Institute of Electrical and Electronics
|
||||
Engineers, Inc.
|
||||
. </span></p></div><div class="biblioentry"><a id="idm140623070977856"></a><p><span class="citetitle"><em class="citetitle">
|
||||
. </span></p></div><div class="biblioentry"><a id="idm234602971056"></a><p><span class="citetitle"><em class="citetitle">
|
||||
The C++ Programming Language, Special Edition
|
||||
</em>. </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
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm140623070973232"></a><p><span class="citetitle"><em class="citetitle">
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm234602966432"></a><p><span class="citetitle"><em class="citetitle">
|
||||
Standard C++ IOStreams and Locales
|
||||
</em>. </span><span class="subtitle">
|
||||
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">
|
||||
Addison Wesley Longman
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm140623070967568"></a><p><span class="title"><em>
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm234602960768"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.lysator.liu.se/c/na1.html" target="_top">
|
||||
A brief description of Normative Addendum 1
|
||||
</a>
|
||||
</em>. </span><span class="author"><span class="firstname">Clive</span> <span class="surname">Feather</span>. </span><span class="pagenums">Extended Character Sets. </span></p></div><div class="biblioentry"><a id="idm140623070964320"></a><p><span class="title"><em>
|
||||
</em>. </span><span class="author"><span class="firstname">Clive</span> <span class="surname">Feather</span>. </span><span class="pagenums">Extended Character Sets. </span></p></div><div class="biblioentry"><a id="idm234602957520"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://tldp.org/HOWTO/Unicode-HOWTO.html" target="_top">
|
||||
The Unicode HOWTO
|
||||
</a>
|
||||
</em>. </span><span class="author"><span class="firstname">Bruno</span> <span class="surname">Haible</span>. </span></p></div><div class="biblioentry"><a id="idm140623070961536"></a><p><span class="title"><em>
|
||||
</em>. </span><span class="author"><span class="firstname">Bruno</span> <span class="surname">Haible</span>. </span></p></div><div class="biblioentry"><a id="idm234602954736"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.cl.cam.ac.uk/~mgk25/unicode.html" target="_top">
|
||||
UTF-8 and Unicode FAQ for Unix/Linux
|
||||
</a>
|
||||
@ -690,39 +705,39 @@ void test01()
|
||||
model. As of this writing, it is unknown how to query to see
|
||||
if a specified message catalog exists using the gettext
|
||||
package.
|
||||
</p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.messages.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm140623070880928"></a><p><span class="citetitle"><em class="citetitle">
|
||||
</p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="facet.messages.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm234602874320"></a><p><span class="citetitle"><em class="citetitle">
|
||||
The GNU C Library
|
||||
</em>. </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="idm140623070876176"></a><p><span class="citetitle"><em class="citetitle">
|
||||
. </span></p></div><div class="biblioentry"><a id="idm234602869568"></a><p><span class="citetitle"><em class="citetitle">
|
||||
Correspondence
|
||||
</em>. </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="idm140623070873088"></a><p><span class="citetitle"><em class="citetitle">
|
||||
</em>. </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="idm234602866480"></a><p><span class="citetitle"><em class="citetitle">
|
||||
ISO/IEC 14882:1998 Programming languages - C++
|
||||
</em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="idm140623070870800"></a><p><span class="citetitle"><em class="citetitle">
|
||||
</em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="idm234602864192"></a><p><span class="citetitle"><em class="citetitle">
|
||||
ISO/IEC 9899:1999 Programming languages - C
|
||||
</em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="idm140623070868528"></a><p><span class="title"><em>
|
||||
</em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="idm234602861920"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.opengroup.org/austin/" target="_top">
|
||||
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
|
||||
</a>
|
||||
</em>. </span><span class="copyright">Copyright © 2008
|
||||
The Open Group/The Institute of Electrical and Electronics
|
||||
Engineers, Inc.
|
||||
. </span></p></div><div class="biblioentry"><a id="idm140623070865296"></a><p><span class="citetitle"><em class="citetitle">
|
||||
. </span></p></div><div class="biblioentry"><a id="idm234602858688"></a><p><span class="citetitle"><em class="citetitle">
|
||||
The C++ Programming Language, Special Edition
|
||||
</em>. </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
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm140623070860672"></a><p><span class="citetitle"><em class="citetitle">
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm234602854064"></a><p><span class="citetitle"><em class="citetitle">
|
||||
Standard C++ IOStreams and Locales
|
||||
</em>. </span><span class="subtitle">
|
||||
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">
|
||||
Addison Wesley Longman
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm140623070855008"></a><p><span class="title"><em>
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm234602848400"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.oracle.com/technetwork/java/api/index.html" target="_top">
|
||||
API Specifications, Java Platform
|
||||
</a>
|
||||
</em>. </span><span class="pagenums">java.util.Properties, java.text.MessageFormat,
|
||||
java.util.Locale, java.util.ResourceBundle
|
||||
. </span></p></div><div class="biblioentry"><a id="idm140623070852672"></a><p><span class="title"><em>
|
||||
. </span></p></div><div class="biblioentry"><a id="idm234602846064"></a><p><span class="title"><em>
|
||||
<a class="link" href="https://www.gnu.org/software/gettext/" target="_top">
|
||||
GNU gettext tools, version 0.10.38, Native Language Support
|
||||
Library and Tools.
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -6,7 +6,7 @@
|
||||
Standard Contents
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="streambufs.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.io"></a>Chapter 13.
|
||||
Input and Output
|
||||
<a id="idm140623070626976" class="indexterm"></a>
|
||||
<a id="idm234602610848" class="indexterm"></a>
|
||||
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="io.html#std.io.objects">Iostream Objects</a></span></dt><dt><span class="section"><a href="streambufs.html">Stream Buffers</a></span></dt><dd><dl><dt><span class="section"><a href="streambufs.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="section"><a href="streambufs.html#io.streambuf.buffering">Buffering</a></span></dt></dl></dd><dt><span class="section"><a href="stringstreams.html">Memory Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="stringstreams.html#std.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="section"><a href="fstreams.html">File Based Streams</a></span></dt><dd><dl><dt><span class="section"><a href="fstreams.html#std.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="section"><a href="fstreams.html#std.io.filestreams.binary">Binary Input and Output</a></span></dt></dl></dd><dt><span class="section"><a href="io_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="io_and_c.html#std.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="section"><a href="io_and_c.html#std.io.c.sync">Performance</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.io.objects"></a>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
|
||||
<iostream> when they don't need to -- and that can <span class="emphasis"><em>penalize
|
||||
|
@ -6,7 +6,7 @@
|
||||
Standard Contents
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="algorithms.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.iterators"></a>Chapter 10.
|
||||
Iterators
|
||||
<a id="idm140623070727584" class="indexterm"></a>
|
||||
<a id="idm234602711264" class="indexterm"></a>
|
||||
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="iterators.html#std.iterators.predefined">Predefined</a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="section"><a href="iterators.html#iterators.predefined.end">One Past the End</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.iterators.predefined"></a>Predefined</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="iterators.predefined.vs_pointers"></a>Iterators vs. Pointers</h3></div></div></div><p>
|
||||
The following
|
||||
FAQ <a class="link" href="../faq.html#faq.iterator_as_pod" title="7.1.">entry</a> points out that
|
||||
|
@ -6,8 +6,8 @@
|
||||
Standard Contents
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="facets.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.localization"></a>Chapter 8.
|
||||
Localization
|
||||
<a id="idm140623071183600" class="indexterm"></a>
|
||||
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#idm140623071106352">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.localization.locales"></a>Locales</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.locales.locale"></a>locale</h3></div></div></div><p>
|
||||
<a id="idm234603203280" class="indexterm"></a>
|
||||
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#idm234603126096">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.localization.locales"></a>Locales</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="std.localization.locales.locale"></a>locale</h3></div></div></div><p>
|
||||
Describes the basic locale object, including nested
|
||||
classes id, facet, and the reference-counted implementation object,
|
||||
class _Impl.
|
||||
@ -402,29 +402,29 @@ global locale" (emphasis Paolo), that is:
|
||||
What should non-required facet instantiations do? If the
|
||||
generic implementation is provided, then how to end-users
|
||||
provide specializations?
|
||||
</p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="locales.locale.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm140623071140624"></a><p><span class="citetitle"><em class="citetitle">
|
||||
</p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="locales.locale.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm234603160304"></a><p><span class="citetitle"><em class="citetitle">
|
||||
The GNU C Library
|
||||
</em>. </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="idm140623071135856"></a><p><span class="citetitle"><em class="citetitle">
|
||||
. </span></p></div><div class="biblioentry"><a id="idm234603155536"></a><p><span class="citetitle"><em class="citetitle">
|
||||
Correspondence
|
||||
</em>. </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="idm140623071132768"></a><p><span class="citetitle"><em class="citetitle">
|
||||
</em>. </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="idm234603152448"></a><p><span class="citetitle"><em class="citetitle">
|
||||
ISO/IEC 14882:1998 Programming languages - C++
|
||||
</em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="idm140623071130480"></a><p><span class="citetitle"><em class="citetitle">
|
||||
</em>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="idm234603150160"></a><p><span class="citetitle"><em class="citetitle">
|
||||
ISO/IEC 9899:1999 Programming languages - C
|
||||
</em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="idm140623071128208"></a><p><span class="title"><em>
|
||||
</em>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="idm234603147888"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.opengroup.org/austin/" target="_top">
|
||||
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
|
||||
</a>
|
||||
</em>. </span><span class="copyright">Copyright © 2008
|
||||
The Open Group/The Institute of Electrical and Electronics
|
||||
Engineers, Inc.
|
||||
. </span></p></div><div class="biblioentry"><a id="idm140623071124976"></a><p><span class="citetitle"><em class="citetitle">
|
||||
. </span></p></div><div class="biblioentry"><a id="idm234603144656"></a><p><span class="citetitle"><em class="citetitle">
|
||||
The C++ Programming Language, Special Edition
|
||||
</em>. </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
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm140623071120352"></a><p><span class="citetitle"><em class="citetitle">
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm234603140032"></a><p><span class="citetitle"><em class="citetitle">
|
||||
Standard C++ IOStreams and Locales
|
||||
</em>. </span><span class="subtitle">
|
||||
Advanced Programmer's Guide and Reference
|
||||
|
@ -92,7 +92,7 @@
|
||||
or loading and unloading shared objects in memory. As such, using
|
||||
caching allocators on systems that do not support
|
||||
<code class="function">abi::__cxa_atexit</code> is not recommended.
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.impl"></a>Implementation</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623072965760"></a>Interface Design</h5></div></div></div><p>
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.impl"></a>Implementation</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm234604985488"></a>Interface Design</h5></div></div></div><p>
|
||||
The only allocator interface that
|
||||
is supported is the standard C++ interface. As such, all STL
|
||||
containers have been adjusted, and all external allocators have
|
||||
@ -105,7 +105,7 @@
|
||||
</p><p>
|
||||
The base class that <code class="classname">allocator</code> is derived from
|
||||
may not be user-configurable.
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623072962208"></a>Selecting Default Allocation Policy</h5></div></div></div><p>
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm234604981936"></a>Selecting Default Allocation Policy</h5></div></div></div><p>
|
||||
It's difficult to pick an allocation strategy that will provide
|
||||
maximum utility, without excessively penalizing some behavior. In
|
||||
fact, it's difficult just deciding which typical actions to measure
|
||||
@ -142,7 +142,7 @@
|
||||
The current default choice for
|
||||
<code class="classname">allocator</code> is
|
||||
<code class="classname">__gnu_cxx::new_allocator</code>.
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623072948912"></a>Disabling Memory Caching</h5></div></div></div><p>
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm234604968640"></a>Disabling Memory Caching</h5></div></div></div><p>
|
||||
In use, <code class="classname">allocator</code> may allocate and
|
||||
deallocate using implementation-specific strategies and
|
||||
heuristics. Because of this, a given call to an allocator object's
|
||||
@ -309,33 +309,33 @@
|
||||
of the used and unused memory locations. It has its own
|
||||
<a class="link" href="bitmap_allocator.html" title="Chapter 21. The bitmap_allocator">chapter</a>
|
||||
in the documentation.
|
||||
</p></li></ol></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm140623072893888"></a><p><span class="citetitle"><em class="citetitle">
|
||||
</p></li></ol></div></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="allocator.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm234603457424"></a><p><span class="citetitle"><em class="citetitle">
|
||||
ISO/IEC 14882:1998 Programming languages - C++
|
||||
</em>. </span>
|
||||
isoc++_1998
|
||||
<span class="pagenums">20.4 Memory. </span></p></div><div class="biblioentry"><a id="idm140623072892048"></a><p><span class="title"><em>
|
||||
<span class="pagenums">20.4 Memory. </span></p></div><div class="biblioentry"><a id="idm234603455584"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.drdobbs.com/the-standard-librarian-what-are-allocato/184403759" target="_top">
|
||||
The Standard Librarian: What Are Allocators Good For?
|
||||
</a>
|
||||
</em>. </span><span class="author"><span class="firstname">Matt</span> <span class="surname">Austern</span>. </span><span class="publisher"><span class="publishername">
|
||||
C/C++ Users Journal
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm140623072888272"></a><p><span class="title"><em>
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm234603451808"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.hoard.org/" target="_top">
|
||||
The Hoard Memory Allocator
|
||||
</a>
|
||||
</em>. </span><span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span></p></div><div class="biblioentry"><a id="idm140623072885504"></a><p><span class="title"><em>
|
||||
</em>. </span><span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span></p></div><div class="biblioentry"><a id="idm234603449040"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://people.cs.umass.edu/~emery/pubs/berger-oopsla2002.pdf" target="_top">
|
||||
Reconsidering Custom Memory Allocation
|
||||
</a>
|
||||
</em>. </span><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></p></div><div class="biblioentry"><a id="idm140623072879344"></a><p><span class="title"><em>
|
||||
</em>. </span><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></p></div><div class="biblioentry"><a id="idm234603442880"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.angelikalanger.com/Articles/C++Report/Allocators/Allocators.html" target="_top">
|
||||
Allocator Types
|
||||
</a>
|
||||
</em>. </span><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
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm140623072874608"></a><p><span class="citetitle"><em class="citetitle">The C++ Programming Language</em>. </span><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></span></p></div><div class="biblioentry"><a id="idm234603438144"></a><p><span class="citetitle"><em class="citetitle">The C++ Programming Language</em>. </span><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
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm140623072870176"></a><p><span class="citetitle"><em class="citetitle">Yalloc: A Recycling C++ Allocator</em>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Yen</span>. </span></p></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="std.util.memory.auto_ptr"></a>auto_ptr</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="auto_ptr.limitations"></a>Limitations</h4></div></div></div><p>Explaining all of the fun and delicious things that can
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm234603433712"></a><p><span class="citetitle"><em class="citetitle">Yalloc: A Recycling C++ Allocator</em>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Yen</span>. </span></p></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="std.util.memory.auto_ptr"></a>auto_ptr</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="auto_ptr.limitations"></a>Limitations</h4></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
|
||||
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>
|
||||
@ -445,7 +445,7 @@ drops to zero.
|
||||
Derived classes override those functions to destroy resources in a context
|
||||
where the correct dynamic type is known. This is an application of the
|
||||
technique known as type erasure.
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.impl"></a>Implementation</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623071372480"></a>Class Hierarchy</h5></div></div></div><p>
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.impl"></a>Implementation</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm234603392608"></a>Class Hierarchy</h5></div></div></div><p>
|
||||
A <code class="classname">shared_ptr<T></code> contains a pointer of
|
||||
type <span class="type">T*</span> and an object of type
|
||||
<code class="classname">__shared_count</code>. The shared_count contains a
|
||||
@ -492,7 +492,7 @@ C++11-only features are: rvalue-ref/move support, allocator support,
|
||||
aliasing constructor, make_shared & allocate_shared. Additionally,
|
||||
the constructors taking <code class="classname">auto_ptr</code> parameters are
|
||||
deprecated in C++11 mode.
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623071349968"></a>Thread Safety</h5></div></div></div><p>
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm234603370096"></a>Thread Safety</h5></div></div></div><p>
|
||||
The
|
||||
<a class="link" href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm#ThreadSafety" target="_top">Thread
|
||||
Safety</a> section of the Boost shared_ptr documentation says "shared_ptr
|
||||
@ -537,7 +537,7 @@ compiler, standard library, platform etc. For the version of
|
||||
shared_ptr in libstdc++ the compiler and library are fixed, which
|
||||
makes things much simpler: we have an atomic CAS or we don't, see Lock
|
||||
Policy below for details.
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623071342672"></a>Selecting Lock Policy</h5></div></div></div><p>
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm234603362800"></a>Selecting Lock Policy</h5></div></div></div><p>
|
||||
</p><p>
|
||||
There is a single <code class="classname">_Sp_counted_base</code> class,
|
||||
which is a template parameterized on the enum
|
||||
@ -578,7 +578,7 @@ used when libstdc++ is built without <code class="literal">--enable-threads</cod
|
||||
<code class="filename">ext/atomicity.h</code>, which detect if the program
|
||||
is multi-threaded. If only one thread of execution exists in
|
||||
the program then less expensive non-atomic operations are used.
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623071328048"></a>Related functions and classes</h5></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="code">dynamic_pointer_cast</code>, <code class="code">static_pointer_cast</code>,
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm234603348176"></a>Related functions and classes</h5></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="code">dynamic_pointer_cast</code>, <code class="code">static_pointer_cast</code>,
|
||||
<code class="code">const_pointer_cast</code></span></dt><dd><p>
|
||||
As noted in N2351, these functions can be implemented non-intrusively using
|
||||
the alias constructor. However the aliasing constructor is only available
|
||||
@ -611,13 +611,13 @@ is called. Users should not try to use this.
|
||||
As well as the extra constructors, this implementation also needs some
|
||||
members of _Sp_counted_deleter to be protected where they could otherwise
|
||||
be private.
|
||||
</p></dd></dl></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.using"></a>Use</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623071311696"></a>Examples</h5></div></div></div><p>
|
||||
</p></dd></dl></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.using"></a>Use</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm234603331760"></a>Examples</h5></div></div></div><p>
|
||||
Examples of use can be found in the testsuite, under
|
||||
<code class="filename">testsuite/tr1/2_general_utilities/shared_ptr</code>,
|
||||
<code class="filename">testsuite/20_util/shared_ptr</code>
|
||||
and
|
||||
<code class="filename">testsuite/20_util/weak_ptr</code>.
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm140623071308112"></a>Unresolved Issues</h5></div></div></div><p>
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idm234603328176"></a>Unresolved Issues</h5></div></div></div><p>
|
||||
The <span class="emphasis"><em><code class="classname">shared_ptr</code> atomic access</em></span>
|
||||
clause in the C++11 standard is not implemented in GCC.
|
||||
</p><p>
|
||||
@ -658,25 +658,25 @@ be private.
|
||||
code to work with, Peter Dimov in particular for his help and
|
||||
invaluable advice on thread safety. Phillip Jordan and Paolo
|
||||
Carlini for the lock policy implementation.
|
||||
</p></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm140623071296880"></a><p><span class="title"><em>
|
||||
</p></div><div class="bibliography"><div class="titlepage"><div><div><h4 class="title"><a id="shared_ptr.biblio"></a>Bibliography</h4></div></div></div><div class="biblioentry"><a id="idm234603316816"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2351.htm" target="_top">
|
||||
Improving shared_ptr for C++0x, Revision 2
|
||||
</a>
|
||||
</em>. </span><span class="subtitle">
|
||||
N2351
|
||||
. </span></p></div><div class="biblioentry"><a id="idm140623071294592"></a><p><span class="title"><em>
|
||||
. </span></p></div><div class="biblioentry"><a id="idm234603314528"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2456.html" target="_top">
|
||||
C++ Standard Library Active Issues List
|
||||
</a>
|
||||
</em>. </span><span class="subtitle">
|
||||
N2456
|
||||
. </span></p></div><div class="biblioentry"><a id="idm140623071292304"></a><p><span class="title"><em>
|
||||
. </span></p></div><div class="biblioentry"><a id="idm234603312240"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2461.pdf" target="_top">
|
||||
Working Draft, Standard for Programming Language C++
|
||||
</a>
|
||||
</em>. </span><span class="subtitle">
|
||||
N2461
|
||||
. </span></p></div><div class="biblioentry"><a id="idm140623071290000"></a><p><span class="title"><em>
|
||||
. </span></p></div><div class="biblioentry"><a id="idm234603309936"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://boost.org/libs/smart_ptr/shared_ptr.htm" target="_top">
|
||||
Boost C++ Libraries documentation, shared_ptr
|
||||
</a>
|
||||
|
@ -6,7 +6,7 @@
|
||||
Standard Contents
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="generalized_numeric_operations.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.numerics"></a>Chapter 12.
|
||||
Numerics
|
||||
<a id="idm140623070670064" class="indexterm"></a>
|
||||
<a id="idm234602653744" class="indexterm"></a>
|
||||
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="numerics.html#std.numerics.complex">Complex</a></span></dt><dd><dl><dt><span class="section"><a href="numerics.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="section"><a href="generalized_numeric_operations.html">Generalized Operations</a></span></dt><dt><span class="section"><a href="numerics_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="numerics_and_c.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="section"><a href="numerics_and_c.html#numerics.c.c99">C99</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.numerics.complex"></a>Complex</h2></div></div></div><p>
|
||||
</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="numerics.complex.processing"></a>complex Processing</h3></div></div></div><p>
|
||||
</p><p>Using <code class="code">complex<></code> becomes even more comple- er, sorry,
|
||||
|
@ -12,11 +12,11 @@ explicit source declaration or by compiling existing sources with a
|
||||
specific compiler flag.
|
||||
</p><div class="section"><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 class="itemizedlist" style="list-style-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 class="itemizedlist" style="list-style-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"><div class="titlepage"><div><div><h2 class="title"><a id="parallel_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry"><a id="idm140623069957824"></a><p><span class="citetitle"><em class="citetitle">
|
||||
<code class="filename">algorithm</code> are included in the parallel mode:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-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"><div class="titlepage"><div><div><h2 class="title"><a id="parallel_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry"><a id="idm234601941840"></a><p><span class="citetitle"><em class="citetitle">
|
||||
Parallelization of Bulk Operations for STL Dictionaries
|
||||
</em>. </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)
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm140623069952752"></a><p><span class="citetitle"><em class="citetitle">
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm234601936768"></a><p><span class="citetitle"><em class="citetitle">
|
||||
The Multi-Core Standard Template Library
|
||||
</em>. </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)
|
||||
|
File diff suppressed because one or more lines are too long
@ -248,7 +248,7 @@
|
||||
these invariants, one must supply some policy that is aware
|
||||
of these changes. Without this, it would be better to use a
|
||||
linked list (in itself very efficient for these purposes).
|
||||
</p></li></ol></div><div class="figure"><a id="idm140623069271200"></a><p class="title"><strong>Figure 22.1. Node Invariants</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_node_invariants.png" align="middle" alt="Node Invariants" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="motivation.associative.underlying"></a>Underlying Data Structures</h5></div></div></div><p>
|
||||
</p></li></ol></div><div class="figure"><a id="idm234601255184"></a><p class="title"><strong>Figure 22.1. Node Invariants</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_node_invariants.png" align="middle" alt="Node Invariants" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="motivation.associative.underlying"></a>Underlying Data Structures</h5></div></div></div><p>
|
||||
The standard C++ library contains associative containers based on
|
||||
red-black trees and collision-chaining hash tables. These are
|
||||
very useful, but they are not ideal for all types of
|
||||
@ -256,7 +256,7 @@
|
||||
</p><p>
|
||||
The figure below shows the different underlying data structures
|
||||
currently supported in this library.
|
||||
</p><div class="figure"><a id="idm140623069264544"></a><p class="title"><strong>Figure 22.2. Underlying Associative Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_different_underlying_dss_1.png" align="middle" alt="Underlying Associative Data Structures" /></div></div></div><br class="figure-break" /><p>
|
||||
</p><div class="figure"><a id="idm234601248528"></a><p class="title"><strong>Figure 22.2. Underlying Associative Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_different_underlying_dss_1.png" align="middle" alt="Underlying Associative Data Structures" /></div></div></div><br class="figure-break" /><p>
|
||||
A shows a collision-chaining hash-table, B shows a probing
|
||||
hash-table, C shows a red-black tree, D shows a splay tree, E shows
|
||||
a tree based on an ordered vector(implicit in the order of the
|
||||
@ -375,7 +375,7 @@
|
||||
no guarantee that the elements traversed will coincide with the
|
||||
<span class="emphasis"><em>logical</em></span> elements between 1 and 5, as in
|
||||
label B.
|
||||
</p><div class="figure"><a id="idm140623069232832"></a><p class="title"><strong>Figure 22.3. Range Iteration in Different Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_point_iterators_range_ops_1.png" align="middle" alt="Node Invariants" /></div></div></div><br class="figure-break" /><p>
|
||||
</p><div class="figure"><a id="idm234601216896"></a><p class="title"><strong>Figure 22.3. Range Iteration in Different Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_point_iterators_range_ops_1.png" align="middle" alt="Node Invariants" /></div></div></div><br class="figure-break" /><p>
|
||||
In our opinion, this problem is not caused just because
|
||||
red-black trees are order preserving while
|
||||
collision-chaining hash tables are (generally) not - it
|
||||
@ -426,7 +426,7 @@
|
||||
list, as in the graphic below, label B. Here the iterators are as
|
||||
light as can be, but the hash-table's operations are more
|
||||
complicated.
|
||||
</p><div class="figure"><a id="idm140623069217984"></a><p class="title"><strong>Figure 22.4. Point Iteration in Hash Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_point_iterators_range_ops_2.png" align="middle" alt="Point Iteration in Hash Data Structures" /></div></div></div><br class="figure-break" /><p>
|
||||
</p><div class="figure"><a id="idm234601202048"></a><p class="title"><strong>Figure 22.4. Point Iteration in Hash Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_point_iterators_range_ops_2.png" align="middle" alt="Point Iteration in Hash Data Structures" /></div></div></div><br class="figure-break" /><p>
|
||||
It should be noted that containers based on collision-chaining
|
||||
hash-tables are not the only ones with this type of behavior;
|
||||
many other self-organizing data structures display it as well.
|
||||
@ -442,7 +442,7 @@
|
||||
container. The graphic below shows three cases: A1 and A2 show
|
||||
a red-black tree; B1 and B2 show a probing hash-table; C1 and C2
|
||||
show a collision-chaining hash table.
|
||||
</p><div class="figure"><a id="idm140623069208720"></a><p class="title"><strong>Figure 22.5. Effect of erase in different underlying data structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_invalidation_guarantee_erase.png" align="middle" alt="Effect of erase in different underlying data structures" /></div></div></div><br class="figure-break" /><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
|
||||
</p><div class="figure"><a id="idm234601192784"></a><p class="title"><strong>Figure 22.5. Effect of erase in different underlying data structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_invalidation_guarantee_erase.png" align="middle" alt="Effect of erase in different underlying data structures" /></div></div></div><br class="figure-break" /><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
|
||||
Erasing 5 from A1 yields A2. Clearly, an iterator to 3 can
|
||||
be de-referenced and incremented. The sequence of iterators
|
||||
changed, but in a way that is well-defined by the interface.
|
||||
@ -678,7 +678,7 @@
|
||||
typically less structured than an associative container's tree;
|
||||
the third simply uses an associative container. These are
|
||||
shown in the figure below with labels A1 and A2, B, and C.
|
||||
</p><div class="figure"><a id="idm140623069141200"></a><p class="title"><strong>Figure 22.6. Underlying Priority Queue Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_different_underlying_dss_2.png" align="middle" alt="Underlying Priority Queue Data Structures" /></div></div></div><br class="figure-break" /><p>
|
||||
</p><div class="figure"><a id="idm234601125200"></a><p class="title"><strong>Figure 22.6. Underlying Priority Queue Data Structures</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_different_underlying_dss_2.png" align="middle" alt="Underlying Priority Queue Data Structures" /></div></div></div><br class="figure-break" /><p>
|
||||
No single implementation can completely replace any of the
|
||||
others. Some have better <code class="function">push</code>
|
||||
and <code class="function">pop</code> amortized performance, some have
|
||||
|
@ -170,7 +170,7 @@
|
||||
naturally; collision-chaining hash tables (label B) store
|
||||
equivalent-key values in the same bucket, the bucket can be
|
||||
arranged so that equivalent-key values are consecutive.
|
||||
</p><div class="figure"><a id="idm140623068883776"></a><p class="title"><strong>Figure 22.8. Non-unique Mapping Standard Containers</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_embedded_lists_1.png" align="middle" alt="Non-unique Mapping Standard Containers" /></div></div></div><br class="figure-break" /><p>
|
||||
</p><div class="figure"><a id="idm234600867728"></a><p class="title"><strong>Figure 22.8. Non-unique Mapping Standard Containers</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_embedded_lists_1.png" align="middle" alt="Non-unique Mapping Standard Containers" /></div></div></div><br class="figure-break" /><p>
|
||||
Put differently, the standards' non-unique mapping
|
||||
associative-containers are associative containers that map
|
||||
primary keys to linked lists that are embedded into the
|
||||
@ -252,7 +252,7 @@
|
||||
first graphic above. Labels A and B, respectively. Each shaded
|
||||
box represents some size-type or secondary
|
||||
associative-container.
|
||||
</p><div class="figure"><a id="idm140623068860272"></a><p class="title"><strong>Figure 22.10. Non-unique Mapping Containers</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_embedded_lists_3.png" align="middle" alt="Non-unique Mapping Containers" /></div></div></div><br class="figure-break" /><p>
|
||||
</p><div class="figure"><a id="idm234600844224"></a><p class="title"><strong>Figure 22.10. Non-unique Mapping Containers</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_embedded_lists_3.png" align="middle" alt="Non-unique Mapping Containers" /></div></div></div><br class="figure-break" /><p>
|
||||
In the first example above, then, one would use an associative
|
||||
container mapping each user to an associative container which
|
||||
maps each application id to a start time (see
|
||||
@ -305,7 +305,7 @@
|
||||
shows invariants for order-preserving containers: point-type
|
||||
iterators are synonymous with range-type iterators.
|
||||
Orthogonally, <span class="emphasis"><em>C</em></span>shows invariants for "set"
|
||||
containers: iterators are synonymous with const iterators.</p><div class="figure"><a id="idm140623068840464"></a><p class="title"><strong>Figure 22.11. Point Iterator Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_point_iterator_hierarchy.png" align="middle" alt="Point Iterator Hierarchy" /></div></div></div><br class="figure-break" /><p>Note that point-type iterators in self-organizing containers
|
||||
containers: iterators are synonymous with const iterators.</p><div class="figure"><a id="idm234600824480"></a><p class="title"><strong>Figure 22.11. Point Iterator Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_point_iterator_hierarchy.png" align="middle" alt="Point Iterator Hierarchy" /></div></div></div><br class="figure-break" /><p>Note that point-type iterators in self-organizing containers
|
||||
(hash-based associative containers) lack movement
|
||||
operators, such as <code class="literal">operator++</code> - in fact, this
|
||||
is the reason why this library differentiates from the standard C++ librarys
|
||||
@ -344,7 +344,7 @@
|
||||
to the question of whether point-type iterators and range-type
|
||||
iterators are valid. The graphic below shows tags corresponding to
|
||||
different types of invalidation guarantees.
|
||||
</p><div class="figure"><a id="idm140623068827120"></a><p class="title"><strong>Figure 22.12. Invalidation Guarantee Tags Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_invalidation_tag_hierarchy.png" align="middle" alt="Invalidation Guarantee Tags Hierarchy" /></div></div></div><br class="figure-break" /><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
|
||||
</p><div class="figure"><a id="idm234600811200"></a><p class="title"><strong>Figure 22.12. Invalidation Guarantee Tags Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_invalidation_tag_hierarchy.png" align="middle" alt="Invalidation Guarantee Tags Hierarchy" /></div></div></div><br class="figure-break" /><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
|
||||
<code class="classname">basic_invalidation_guarantee</code>
|
||||
corresponds to a basic guarantee that a point-type iterator,
|
||||
a found pointer, or a found reference, remains valid as long
|
||||
@ -428,7 +428,7 @@
|
||||
</p><p>
|
||||
This library contains a container tag hierarchy corresponding to the
|
||||
diagram below.
|
||||
</p><div class="figure"><a id="idm140623068796896"></a><p class="title"><strong>Figure 22.13. Container Tag Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_container_tag_hierarchy.png" align="middle" alt="Container Tag Hierarchy" /></div></div></div><br class="figure-break" /><p>
|
||||
</p><div class="figure"><a id="idm234600780976"></a><p class="title"><strong>Figure 22.13. Container Tag Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_container_tag_hierarchy.png" align="middle" alt="Container Tag Hierarchy" /></div></div></div><br class="figure-break" /><p>
|
||||
Given any container <span class="type">Cntnr</span>, the tag of
|
||||
the underlying data structure can be found via <code class="literal">typename
|
||||
Cntnr::container_category</code>.
|
||||
@ -487,7 +487,7 @@
|
||||
collision-chaining container, except for the following.</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p><code class="classname">Comb_Probe_Fn</code> describes how to transform a probe
|
||||
sequence into a sequence of positions within the table.</p></li><li class="listitem"><p><code class="classname">Probe_Fn</code> describes a probe sequence policy.</p></li></ol></div><p>Some of the default template values depend on the values of
|
||||
other parameters, and are explained below.</p></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="container.hash.details"></a>Details</h5></div></div></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.hash.details.hash_policies"></a>Hash Policies</h6></div></div></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="details.hash_policies.general"></a>General</h6></div></div></div><p>Following is an explanation of some functions which hashing
|
||||
involves. The graphic below illustrates the discussion.</p><div class="figure"><a id="idm140623068756816"></a><p class="title"><strong>Figure 22.14. Hash functions, ranged-hash functions, and
|
||||
involves. The graphic below illustrates the discussion.</p><div class="figure"><a id="idm234600740768"></a><p class="title"><strong>Figure 22.14. Hash functions, ranged-hash functions, and
|
||||
range-hashing functions</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_hash_ranged_hash_range_hashing_fns.png" align="middle" alt="Hash functions, ranged-hash functions, and range-hashing functions" /></div></div></div><br class="figure-break" /><p>Let U be a domain (e.g., the integers, or the
|
||||
strings of 3 characters). A hash-table algorithm needs to map
|
||||
elements of U "uniformly" into the range [0,..., m -
|
||||
@ -504,7 +504,7 @@
|
||||
Z<sub>+</sub>,</p><p>which maps a non-negative hash value, and a non-negative
|
||||
range upper-bound into a non-negative integral in the range
|
||||
between 0 (inclusive) and the range upper bound (exclusive),
|
||||
i.e., for any r in Z<sub>+</sub>,</p><p>0 ≤ g(r, m) ≤ m - 1</p><p>The resulting ranged-hash function, is</p><div class="equation"><a id="idm140623068743008"></a><p class="title"><strong>Equation 22.1. Ranged Hash Function</strong></p><div class="equation-contents"><span class="mathphrase">
|
||||
i.e., for any r in Z<sub>+</sub>,</p><p>0 ≤ g(r, m) ≤ m - 1</p><p>The resulting ranged-hash function, is</p><div class="equation"><a id="idm234600726944"></a><p class="title"><strong>Equation 22.1. Ranged Hash Function</strong></p><div class="equation-contents"><span class="mathphrase">
|
||||
f(u , m) = g(h(u), m)
|
||||
</span></div></div><br class="equation-break" /><p>From the above, it is obvious that given g and
|
||||
h, f can always be composed (however the converse
|
||||
@ -524,7 +524,7 @@
|
||||
transforming the sequence of hash values into a sequence of
|
||||
positions.</p></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="details.hash_policies.range"></a>Range Hashing</h6></div></div></div><p>Some common choices for range-hashing functions are the
|
||||
division, multiplication, and middle-square methods (<a class="xref" href="policy_data_structures.html#biblio.knuth98sorting" title="The Art of Computer Programming - Sorting and Searching">[biblio.knuth98sorting]</a>), defined
|
||||
as</p><div class="equation"><a id="idm140623068737184"></a><p class="title"><strong>Equation 22.2. Range-Hashing, Division Method</strong></p><div class="equation-contents"><span class="mathphrase">
|
||||
as</p><div class="equation"><a id="idm234600721056"></a><p class="title"><strong>Equation 22.2. Range-Hashing, Division Method</strong></p><div class="equation-contents"><span class="mathphrase">
|
||||
g(r, m) = r mod m
|
||||
</span></div></div><br class="equation-break" /><p>g(r, m) = ⌈ u/v ( a r mod v ) ⌉</p><p>and</p><p>g(r, m) = ⌈ u/v ( r<sup>2</sup> mod v ) ⌉</p><p>respectively, for some positive integrals u and
|
||||
v (typically powers of 2), and some a. Each of
|
||||
@ -535,9 +535,9 @@
|
||||
implement using the low
|
||||
level % (modulo) operation (for any m), or the
|
||||
low level & (bit-mask) operation (for the case where
|
||||
m is a power of 2), i.e.,</p><div class="equation"><a id="idm140623068732672"></a><p class="title"><strong>Equation 22.3. Division via Prime Modulo</strong></p><div class="equation-contents"><span class="mathphrase">
|
||||
m is a power of 2), i.e.,</p><div class="equation"><a id="idm234600716544"></a><p class="title"><strong>Equation 22.3. Division via Prime Modulo</strong></p><div class="equation-contents"><span class="mathphrase">
|
||||
g(r, m) = r % m
|
||||
</span></div></div><br class="equation-break" /><p>and</p><div class="equation"><a id="idm140623068730848"></a><p class="title"><strong>Equation 22.4. Division via Bit Mask</strong></p><div class="equation-contents"><span class="mathphrase">
|
||||
</span></div></div><br class="equation-break" /><p>and</p><div class="equation"><a id="idm234600714720"></a><p class="title"><strong>Equation 22.4. Division via Bit Mask</strong></p><div class="equation-contents"><span class="mathphrase">
|
||||
g(r, m) = r & m - 1, (with m =
|
||||
2<sup>k</sup> for some k)
|
||||
</span></div></div><br class="equation-break" /><p>respectively.</p><p>The % (modulo) implementation has the advantage that for
|
||||
@ -563,7 +563,7 @@
|
||||
s = [ s<sub>0</sub>,..., s<sub>t - 1</sub>]
|
||||
</p><p>be a string of t characters, each of which is from
|
||||
domain S. Consider the following ranged-hash
|
||||
function:</p><div class="equation"><a id="idm140623068721216"></a><p class="title"><strong>Equation 22.5.
|
||||
function:</p><div class="equation"><a id="idm234600705088"></a><p class="title"><strong>Equation 22.5.
|
||||
A Standard String Hash Function
|
||||
</strong></p><div class="equation-contents"><span class="mathphrase">
|
||||
f<sub>1</sub>(s, m) = ∑ <sub>i =
|
||||
@ -575,7 +575,7 @@
|
||||
of a long DNA sequence (and so S = {'A', 'C', 'G',
|
||||
'T'}). In this case, scanning the entire string might be
|
||||
prohibitively expensive. A possible alternative might be to use
|
||||
only the first k characters of the string, where</p><p>|S|<sup>k</sup> ≥ m ,</p><p>i.e., using the hash function</p><div class="equation"><a id="idm140623068715072"></a><p class="title"><strong>Equation 22.6.
|
||||
only the first k characters of the string, where</p><p>|S|<sup>k</sup> ≥ m ,</p><p>i.e., using the hash function</p><div class="equation"><a id="idm234600698944"></a><p class="title"><strong>Equation 22.6.
|
||||
Only k String DNA Hash
|
||||
</strong></p><div class="equation-contents"><span class="mathphrase">
|
||||
f<sub>2</sub>(s, m) = ∑ <sub>i
|
||||
@ -606,12 +606,12 @@
|
||||
the container transforms the key into a non-negative integral
|
||||
using the hash functor (points B and C), and transforms the
|
||||
result into a position using the combining functor (points D
|
||||
and E).</p><div class="figure"><a id="idm140623068692448"></a><p class="title"><strong>Figure 22.15. Insert hash sequence diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_hash_range_hashing_seq_diagram.png" align="middle" alt="Insert hash sequence diagram" /></div></div></div><br class="figure-break" /><p>If <code class="classname">cc_hash_table</code>'s
|
||||
and E).</p><div class="figure"><a id="idm234600676384"></a><p class="title"><strong>Figure 22.15. Insert hash sequence diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_hash_range_hashing_seq_diagram.png" align="middle" alt="Insert hash sequence diagram" /></div></div></div><br class="figure-break" /><p>If <code class="classname">cc_hash_table</code>'s
|
||||
hash-functor, <code class="classname">Hash_Fn</code> is instantiated by <code class="classname">null_type</code> , then <code class="classname">Comb_Hash_Fn</code> is taken to be
|
||||
a ranged-hash function. The graphic below shows an <code class="function">insert</code> sequence
|
||||
diagram. The user inserts an element (point A), the container
|
||||
transforms the key into a position using the combining functor
|
||||
(points B and C).</p><div class="figure"><a id="idm140623068685392"></a><p class="title"><strong>Figure 22.16. Insert hash sequence diagram with a null policy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_hash_range_hashing_seq_diagram2.png" align="middle" alt="Insert hash sequence diagram with a null policy" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="hash_policies.implementation.probe"></a>
|
||||
(points B and C).</p><div class="figure"><a id="idm234600669328"></a><p class="title"><strong>Figure 22.16. Insert hash sequence diagram with a null policy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_hash_range_hashing_seq_diagram2.png" align="middle" alt="Insert hash sequence diagram with a null policy" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="hash_policies.implementation.probe"></a>
|
||||
Probing tables
|
||||
</h6></div></div></div><p><code class="classname">gp_hash_table</code> is parametrized by
|
||||
<code class="classname">Hash_Fn</code>, <code class="classname">Probe_Fn</code>,
|
||||
@ -634,7 +634,7 @@
|
||||
a linear probe and a quadratic probe function,
|
||||
respectively.</p></li></ol></div><p>
|
||||
The graphic below shows the relationships.
|
||||
</p><div class="figure"><a id="idm140623068668640"></a><p class="title"><strong>Figure 22.17. Hash policy class diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_hash_policy_cd.png" align="middle" alt="Hash policy class diagram" /></div></div></div><br class="figure-break" /></div></div></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.hash.details.resize_policies"></a>Resize Policies</h6></div></div></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="resize_policies.general"></a>General</h6></div></div></div><p>Hash-tables, as opposed to trees, do not naturally grow or
|
||||
</p><div class="figure"><a id="idm234600652512"></a><p class="title"><strong>Figure 22.17. Hash policy class diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_hash_policy_cd.png" align="middle" alt="Hash policy class diagram" /></div></div></div><br class="figure-break" /></div></div></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.hash.details.resize_policies"></a>Resize Policies</h6></div></div></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="resize_policies.general"></a>General</h6></div></div></div><p>Hash-tables, as opposed to trees, do not naturally grow or
|
||||
shrink. It is necessary to specify policies to determine how
|
||||
and when a hash table should change its size. Usually, resize
|
||||
policies can be decomposed into orthogonal policies:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>A size policy indicating how a hash table
|
||||
@ -667,10 +667,10 @@
|
||||
and some load factor be denoted by Α. We would like to
|
||||
calculate the minimal length of k, such that if there were Α
|
||||
m elements in the hash table, a probe sequence of length k would
|
||||
be found with probability at most 1/m.</p><div class="figure"><a id="idm140623068649600"></a><p class="title"><strong>Figure 22.18. Balls and bins</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_balls_and_bins.png" align="middle" alt="Balls and bins" /></div></div></div><br class="figure-break" /><p>Denote the probability that a probe sequence of length
|
||||
be found with probability at most 1/m.</p><div class="figure"><a id="idm234600633472"></a><p class="title"><strong>Figure 22.18. Balls and bins</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_balls_and_bins.png" align="middle" alt="Balls and bins" /></div></div></div><br class="figure-break" /><p>Denote the probability that a probe sequence of length
|
||||
k appears in bin i by p<sub>i</sub>, the
|
||||
length of the probe sequence of bin i by
|
||||
l<sub>i</sub>, and assume uniform distribution. Then</p><div class="equation"><a id="idm140623068644096"></a><p class="title"><strong>Equation 22.7.
|
||||
l<sub>i</sub>, and assume uniform distribution. Then</p><div class="equation"><a id="idm234600627968"></a><p class="title"><strong>Equation 22.7.
|
||||
Probability of Probe Sequence of Length k
|
||||
</strong></p><div class="equation-contents"><span class="mathphrase">
|
||||
p<sub>1</sub> =
|
||||
@ -684,7 +684,7 @@
|
||||
l<sub>i</sub> are negatively-dependent
|
||||
(<a class="xref" href="policy_data_structures.html#biblio.dubhashi98neg" title="Balls and bins: A study in negative dependence">[biblio.dubhashi98neg]</a>)
|
||||
. Let
|
||||
I(.) denote the indicator function. Then</p><div class="equation"><a id="idm140623068637328"></a><p class="title"><strong>Equation 22.8.
|
||||
I(.) denote the indicator function. Then</p><div class="equation"><a id="idm234600621200"></a><p class="title"><strong>Equation 22.8.
|
||||
Probability Probe Sequence in Some Bin
|
||||
</strong></p><div class="equation-contents"><span class="mathphrase">
|
||||
P( exists<sub>i</sub> l<sub>i</sub> ≥ k ) =
|
||||
@ -723,7 +723,7 @@
|
||||
a resize is needed, and if so, what is the new size (points D
|
||||
to G); following the resize, it notifies the policy that a
|
||||
resize has completed (point H); finally, the element is
|
||||
inserted, and the policy notified (point I).</p><div class="figure"><a id="idm140623068618880"></a><p class="title"><strong>Figure 22.19. Insert resize sequence diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_insert_resize_sequence_diagram1.png" align="middle" alt="Insert resize sequence diagram" /></div></div></div><br class="figure-break" /><p>In practice, a resize policy can be usually orthogonally
|
||||
inserted, and the policy notified (point I).</p><div class="figure"><a id="idm234600602752"></a><p class="title"><strong>Figure 22.19. Insert resize sequence diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_insert_resize_sequence_diagram1.png" align="middle" alt="Insert resize sequence diagram" /></div></div></div><br class="figure-break" /><p>In practice, a resize policy can be usually orthogonally
|
||||
decomposed to a size policy and a trigger policy. Consequently,
|
||||
the library contains a single class for instantiating a resize
|
||||
policy: <code class="classname">hash_standard_resize_policy</code>
|
||||
@ -732,8 +732,8 @@
|
||||
both, and acts as a standard delegate (<a class="xref" href="policy_data_structures.html#biblio.gof" title="Design Patterns - Elements of Reusable Object-Oriented Software">[biblio.gof]</a>)
|
||||
to these policies.</p><p>The two graphics immediately below show sequence diagrams
|
||||
illustrating the interaction between the standard resize policy
|
||||
and its trigger and size policies, respectively.</p><div class="figure"><a id="idm140623068611104"></a><p class="title"><strong>Figure 22.20. Standard resize policy trigger sequence
|
||||
diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_insert_resize_sequence_diagram2.png" align="middle" alt="Standard resize policy trigger sequence diagram" /></div></div></div><br class="figure-break" /><div class="figure"><a id="idm140623068606944"></a><p class="title"><strong>Figure 22.21. Standard resize policy size sequence
|
||||
and its trigger and size policies, respectively.</p><div class="figure"><a id="idm234600594976"></a><p class="title"><strong>Figure 22.20. Standard resize policy trigger sequence
|
||||
diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_insert_resize_sequence_diagram2.png" align="middle" alt="Standard resize policy trigger sequence diagram" /></div></div></div><br class="figure-break" /><div class="figure"><a id="idm234600590816"></a><p class="title"><strong>Figure 22.21. Standard resize policy size sequence
|
||||
diagram</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_insert_resize_sequence_diagram3.png" align="middle" alt="Standard resize policy size sequence diagram" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="resize_policies.impl.predefined"></a>Predefined Policies</h6></div></div></div><p>The library includes the following
|
||||
instantiations of size and trigger policies:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p><code class="classname">hash_load_check_resize_trigger</code>
|
||||
implements a load check trigger policy.</p></li><li class="listitem"><p><code class="classname">cc_hash_max_collision_check_resize_trigger</code>
|
||||
@ -876,7 +876,7 @@
|
||||
each node, and maintains node invariants (see <a class="xref" href="policy_data_structures.html#biblio.clrs2001" title="Introduction to Algorithms, 2nd edition">[biblio.clrs2001]</a>.) The first stores in
|
||||
each node the size of the sub-tree rooted at the node; the
|
||||
second stores at each node the maximal endpoint of the
|
||||
intervals at the sub-tree rooted at the node.</p><div class="figure"><a id="idm140623068528896"></a><p class="title"><strong>Figure 22.22. Tree node invariants</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_tree_node_invariants.png" align="middle" alt="Tree node invariants" /></div></div></div><br class="figure-break" /><p>Supporting such trees is difficult for a number of
|
||||
intervals at the sub-tree rooted at the node.</p><div class="figure"><a id="idm234600512848"></a><p class="title"><strong>Figure 22.22. Tree node invariants</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_tree_node_invariants.png" align="middle" alt="Tree node invariants" /></div></div></div><br class="figure-break" /><p>Supporting such trees is difficult for a number of
|
||||
reasons:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>There must be a way to specify what a node's metadata
|
||||
should be (if any).</p></li><li class="listitem"><p>Various operations can invalidate node
|
||||
invariants. The graphic below shows how a right rotation,
|
||||
@ -890,7 +890,7 @@
|
||||
metadata.</p></li><li class="listitem"><p>It is not feasible to know in advance which methods trees
|
||||
can support. Besides the usual <code class="classname">find</code> method, the
|
||||
first tree can support a <code class="classname">find_by_order</code> method, while
|
||||
the second can support an <code class="classname">overlaps</code> method.</p></li></ol></div><div class="figure"><a id="idm140623068519456"></a><p class="title"><strong>Figure 22.23. Tree node invalidation</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_tree_node_invalidations.png" align="middle" alt="Tree node invalidation" /></div></div></div><br class="figure-break" /><p>These problems are solved by a combination of two means:
|
||||
the second can support an <code class="classname">overlaps</code> method.</p></li></ol></div><div class="figure"><a id="idm234600503408"></a><p class="title"><strong>Figure 22.23. Tree node invalidation</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_tree_node_invalidations.png" align="middle" alt="Tree node invalidation" /></div></div></div><br class="figure-break" /><p>These problems are solved by a combination of two means:
|
||||
node iterators, and template-template node updater
|
||||
parameters.</p><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.tree.node.iterators"></a>Node Iterators</h6></div></div></div><p>Each tree-based container defines two additional iterator
|
||||
types, <code class="classname">const_node_iterator</code>
|
||||
@ -919,7 +919,7 @@
|
||||
<code class="classname">node_update</code> class, and publicly subclasses
|
||||
<code class="classname">node_update</code>. The graphic below shows this
|
||||
scheme, as well as some predefined policies (which are explained
|
||||
below).</p><div class="figure"><a id="idm140623068506288"></a><p class="title"><strong>Figure 22.24. A tree and its update policy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_tree_node_updator_policy_cd.png" align="middle" alt="A tree and its update policy" /></div></div></div><br class="figure-break" /><p><code class="classname">node_update</code> (an instantiation of
|
||||
below).</p><div class="figure"><a id="idm234600490240"></a><p class="title"><strong>Figure 22.24. A tree and its update policy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_tree_node_updator_policy_cd.png" align="middle" alt="A tree and its update policy" /></div></div></div><br class="figure-break" /><p><code class="classname">node_update</code> (an instantiation of
|
||||
<code class="classname">Node_Update</code>) must define <code class="classname">metadata_type</code> as
|
||||
the type of metadata it requires. For order statistics,
|
||||
e.g., <code class="classname">metadata_type</code> might be <code class="classname">size_t</code>.
|
||||
@ -938,7 +938,7 @@
|
||||
<code class="classname">nd_it</code>. For example, say node x in the
|
||||
graphic below label A has an invalid invariant, but its' children,
|
||||
y and z have valid invariants. After the invocation, all three
|
||||
nodes should have valid invariants, as in label B.</p><div class="figure"><a id="idm140623068494624"></a><p class="title"><strong>Figure 22.25. Restoring node invariants</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_restoring_node_invariants.png" align="middle" alt="Restoring node invariants" /></div></div></div><br class="figure-break" /><p>When a tree operation might invalidate some node invariant,
|
||||
nodes should have valid invariants, as in label B.</p><div class="figure"><a id="idm234600478576"></a><p class="title"><strong>Figure 22.25. Restoring node invariants</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_restoring_node_invariants.png" align="middle" alt="Restoring node invariants" /></div></div></div><br class="figure-break" /><p>When a tree operation might invalidate some node invariant,
|
||||
it invokes this method in its <code class="classname">node_update</code> base to
|
||||
restore the invariant. For example, the graphic below shows
|
||||
an <code class="function">insert</code> operation (point A); the tree performs some
|
||||
@ -946,7 +946,7 @@
|
||||
C, and D). (It is well known that any <code class="function">insert</code>,
|
||||
<code class="function">erase</code>, <code class="function">split</code> or <code class="function">join</code>, can restore
|
||||
all node invariants by a small number of node invariant updates (<a class="xref" href="policy_data_structures.html#biblio.clrs2001" title="Introduction to Algorithms, 2nd edition">[biblio.clrs2001]</a>)
|
||||
.</p><div class="figure"><a id="idm140623068486448"></a><p class="title"><strong>Figure 22.26. Insert update sequence</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_update_seq_diagram.png" align="middle" alt="Insert update sequence" /></div></div></div><br class="figure-break" /><p>To complete the description of the scheme, three questions
|
||||
.</p><div class="figure"><a id="idm234600470400"></a><p class="title"><strong>Figure 22.26. Insert update sequence</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_update_seq_diagram.png" align="middle" alt="Insert update sequence" /></div></div></div><br class="figure-break" /><p>To complete the description of the scheme, three questions
|
||||
need to be answered:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>How can a tree which supports order statistics define a
|
||||
method such as <code class="classname">find_by_order</code>?</p></li><li class="listitem"><p>How can the node updater base access methods of the
|
||||
tree?</p></li><li class="listitem"><p>How can the following cyclic dependency be resolved?
|
||||
@ -988,7 +988,7 @@
|
||||
node's metadata (this is halting reducible). In the graphic
|
||||
below, assume the shaded node is inserted. The tree would have
|
||||
to traverse the useless path shown to the root, applying
|
||||
redundant updates all the way.</p></li></ol></div><div class="figure"><a id="idm140623068464192"></a><p class="title"><strong>Figure 22.27. Useless update path</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_rationale_null_node_updator.png" align="middle" alt="Useless update path" /></div></div></div><br class="figure-break" /><p>A null policy class, <code class="classname">null_node_update</code>
|
||||
redundant updates all the way.</p></li></ol></div><div class="figure"><a id="idm234600448144"></a><p class="title"><strong>Figure 22.27. Useless update path</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_rationale_null_node_updator.png" align="middle" alt="Useless update path" /></div></div></div><br class="figure-break" /><p>A null policy class, <code class="classname">null_node_update</code>
|
||||
solves both these problems. The tree detects that node
|
||||
invariants are irrelevant, and defines all accordingly.</p></div></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.tree.details.split"></a>Split and Join</h6></div></div></div><p>Tree-based containers support split and join methods.
|
||||
It is possible to split a tree so that it passes
|
||||
@ -1071,7 +1071,7 @@
|
||||
sub-tree with leafs "a" and "as". The maximal common prefix is
|
||||
"a". The internal node contains, consequently, to const
|
||||
iterators, one pointing to <code class="varname">'a'</code>, and the other to
|
||||
<code class="varname">'s'</code>.</p><div class="figure"><a id="idm140623068419552"></a><p class="title"><strong>Figure 22.28. A PATRICIA trie</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_pat_trie.png" align="middle" alt="A PATRICIA trie" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.trie.details.node"></a>Node Invariants</h6></div></div></div><p>Trie-based containers support node invariants, as do
|
||||
<code class="varname">'s'</code>.</p><div class="figure"><a id="idm234600403456"></a><p class="title"><strong>Figure 22.28. A PATRICIA trie</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_pat_trie.png" align="middle" alt="A PATRICIA trie" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.trie.details.node"></a>Node Invariants</h6></div></div></div><p>Trie-based containers support node invariants, as do
|
||||
tree-based containers. There are two minor
|
||||
differences, though, which, unfortunately, thwart sharing them
|
||||
sharing the same node-updating policies:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>A trie's <code class="classname">Node_Update</code> template-template
|
||||
@ -1080,7 +1080,7 @@
|
||||
parametrized by <code class="classname">Cmp_Fn</code>.</p></li><li class="listitem"><p>Tree-based containers store values in all nodes, while
|
||||
trie-based containers (at least in this implementation) store
|
||||
values in leafs.</p></li></ol></div><p>The graphic below shows the scheme, as well as some predefined
|
||||
policies (which are explained below).</p><div class="figure"><a id="idm140623068409120"></a><p class="title"><strong>Figure 22.29. A trie and its update policy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_trie_node_updator_policy_cd.png" align="middle" alt="A trie and its update policy" /></div></div></div><br class="figure-break" /><p>This library offers the following pre-defined trie node
|
||||
policies (which are explained below).</p><div class="figure"><a id="idm234600392960"></a><p class="title"><strong>Figure 22.29. A trie and its update policy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_trie_node_updator_policy_cd.png" align="middle" alt="A trie and its update policy" /></div></div></div><br class="figure-break" /><p>This library offers the following pre-defined trie node
|
||||
updating policies:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
|
||||
<code class="classname">trie_order_statistics_node_update</code>
|
||||
supports order statistics.
|
||||
@ -1128,7 +1128,7 @@
|
||||
simple list of integer keys. If we search for the integer 6, we
|
||||
are paying an overhead: the link with key 6 is only the fifth
|
||||
link; if it were the first link, it could be accessed
|
||||
faster.</p><div class="figure"><a id="idm140623068378480"></a><p class="title"><strong>Figure 22.30. A simple list</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_simple_list.png" align="middle" alt="A simple list" /></div></div></div><br class="figure-break" /><p>List-update algorithms reorder lists as elements are
|
||||
faster.</p><div class="figure"><a id="idm234600362320"></a><p class="title"><strong>Figure 22.30. A simple list</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_simple_list.png" align="middle" alt="A simple list" /></div></div></div><br class="figure-break" /><p>List-update algorithms reorder lists as elements are
|
||||
accessed. They try to determine, by the access history, which
|
||||
keys to move to the front of the list. Some of these algorithms
|
||||
require adding some metadata alongside each entry.</p><p>For example, in the graphic below label A shows the counter
|
||||
@ -1138,7 +1138,7 @@
|
||||
predetermined value, say 10, as shown in label C, the count is set
|
||||
to 0 and the node is moved to the front of the list, as in label
|
||||
D.
|
||||
</p><div class="figure"><a id="idm140623068372896"></a><p class="title"><strong>Figure 22.31. The counter algorithm</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_list_update.png" align="middle" alt="The counter algorithm" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.list.details.policies"></a>Policies</h6></div></div></div><p>this library allows instantiating lists with policies
|
||||
</p><div class="figure"><a id="idm234600356736"></a><p class="title"><strong>Figure 22.31. The counter algorithm</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_list_update.png" align="middle" alt="The counter algorithm" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h6 class="title"><a id="container.list.details.policies"></a>Policies</h6></div></div></div><p>this library allows instantiating lists with policies
|
||||
implementing any algorithm moving nodes to the front of the
|
||||
list (policies implementing algorithms interchanging nodes are
|
||||
unsupported).</p><p>Associative containers based on lists are parametrized by a
|
||||
@ -1310,7 +1310,7 @@
|
||||
sequence; the second uses a tree (or forest of trees), which is
|
||||
typically less structured than an associative container's tree;
|
||||
the third simply uses an associative container. These are
|
||||
shown in the graphic below, in labels A1 and A2, label B, and label C.</p><div class="figure"><a id="idm140623068309072"></a><p class="title"><strong>Figure 22.32. Underlying Priority-Queue Data-Structures.</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_priority_queue_different_underlying_dss.png" align="middle" alt="Underlying Priority-Queue Data-Structures." /></div></div></div><br class="figure-break" /><p>Roughly speaking, any value that is both pushed and popped
|
||||
shown in the graphic below, in labels A1 and A2, label B, and label C.</p><div class="figure"><a id="idm234600293024"></a><p class="title"><strong>Figure 22.32. Underlying Priority-Queue Data-Structures.</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_priority_queue_different_underlying_dss.png" align="middle" alt="Underlying Priority-Queue Data-Structures." /></div></div></div><br class="figure-break" /><p>Roughly speaking, any value that is both pushed and popped
|
||||
from a priority queue must incur a logarithmic expense (in the
|
||||
amortized sense). Any priority queue implementation that would
|
||||
avoid this, would violate known bounds on comparison-based
|
||||
@ -1390,7 +1390,7 @@
|
||||
container <code class="classname">Cntnr</code>, the tag of the underlying
|
||||
data structure can be found via <code class="classname">typename
|
||||
Cntnr::container_category</code>; this is one of the possible tags shown in the graphic below.
|
||||
</p><div class="figure"><a id="idm140623068274032"></a><p class="title"><strong>Figure 22.33. Priority-Queue Data-Structure Tags.</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_priority_queue_tag_hierarchy.png" align="middle" alt="Priority-Queue Data-Structure Tags." /></div></div></div><br class="figure-break" /><p>Additionally, a traits mechanism can be used to query a
|
||||
</p><div class="figure"><a id="idm234600257984"></a><p class="title"><strong>Figure 22.33. Priority-Queue Data-Structure Tags.</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_priority_queue_tag_hierarchy.png" align="middle" alt="Priority-Queue Data-Structure Tags." /></div></div></div><br class="figure-break" /><p>Additionally, a traits mechanism can be used to query a
|
||||
container type for its attributes. Given any container
|
||||
<code class="classname">Cntnr</code>, then </p><pre class="programlisting">__gnu_pbds::container_traits<Cntnr></pre><p>
|
||||
is a traits class identifying the properties of the
|
||||
|
@ -61,7 +61,7 @@
|
||||
In addition, there are the following diagnostics classes,
|
||||
used to report errors specific to this library's data
|
||||
structures.
|
||||
</p><div class="figure"><a id="idm140623069078560"></a><p class="title"><strong>Figure 22.7. Exception Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_exception_hierarchy.png" align="middle" alt="Exception Hierarchy" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.using.tutorial"></a>Tutorial</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.using.tutorial.basic"></a>Basic Use</h4></div></div></div><p>
|
||||
</p><div class="figure"><a id="idm234601062432"></a><p class="title"><strong>Figure 22.7. Exception Hierarchy</strong></p><div class="figure-contents"><div class="mediaobject" align="center"><img src="../images/pbds_exception_hierarchy.png" align="middle" alt="Exception Hierarchy" /></div></div></div><br class="figure-break" /></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="pbds.using.tutorial"></a>Tutorial</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="pbds.using.tutorial.basic"></a>Basic Use</h4></div></div></div><p>
|
||||
For the most part, the policy-based containers containers in
|
||||
namespace <code class="literal">__gnu_pbds</code> have the same interface as
|
||||
the equivalent containers in the standard C++ library, except for
|
||||
|
@ -137,7 +137,7 @@ vector-size: improvement = 3: call stack = 0x804842c ...
|
||||
call context.
|
||||
(Environment variable not supported.)
|
||||
</p></li></ul></div><p>
|
||||
</p></div></div><div class="bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="profile_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry"><a id="idm140623069489616"></a><p><span class="citetitle"><em class="citetitle">
|
||||
</p></div></div><div class="bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="profile_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry"><a id="idm234601473232"></a><p><span class="citetitle"><em class="citetitle">
|
||||
Perflint: A Context Sensitive Performance Advisor for C++ Programs
|
||||
</em>. </span><span class="author"><span class="firstname">Lixia</span> <span class="surname">Liu</span>. </span><span class="author"><span class="firstname">Silvius</span> <span class="surname">Rus</span>. </span><span class="copyright">Copyright © 2009 . </span><span class="publisher"><span class="publishername">
|
||||
Proceedings of the 2009 International Symposium on Code Generation
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?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"><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-NS Stylesheets V1.78.1" /><meta name="keywords" content="C++, library, profile" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="profile_mode.html" title="Chapter 19. Profile Mode" /><link rel="prev" href="profile_mode.html" title="Chapter 19. Profile Mode" /><link rel="next" href="profile_mode_api.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 19. Profile Mode</th><td width="20%" align="right"> <a accesskey="n" href="profile_mode_api.html">Next</a></td></tr></table><hr /></div><div class="section"><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="idm140623069903616"></a><p class="title"><strong>Table 19.1. Profile Code Location</strong></p><div class="table-contents"><table summary="Profile Code Location" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></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="idm234601887440"></a><p class="title"><strong>Table 19.1. Profile Code Location</strong></p><div class="table-contents"><table summary="Profile Code Location" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></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
|
||||
file included from the public headers.</td></tr></tbody></table></div></div><br class="table-break" /><p>
|
||||
</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.ext.profile_mode.design.wrapper"></a>Wrapper Model</h3></div></div></div><p>
|
||||
|
@ -17,7 +17,7 @@
|
||||
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
|
||||
specific needs or time budgets.
|
||||
</p><div class="table"><a id="idm140623069796224"></a><p class="title"><strong>Table 19.2. Profile Diagnostics</strong></p><div class="table-contents"><table summary="Profile Diagnostics" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /><col align="left" class="c6" /><col align="left" class="c7" /></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><td class="auto-generated"> </td></tr></thead><tbody><tr><td align="left"><a class="link" href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.containers" title="Containers">
|
||||
</p><div class="table"><a id="idm234601779968"></a><p class="title"><strong>Table 19.2. Profile Diagnostics</strong></p><div class="table-contents"><table summary="Profile Diagnostics" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /><col align="left" class="c3" /><col align="left" class="c4" /><col align="left" class="c5" /><col align="left" class="c6" /><col align="left" class="c7" /></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><td class="auto-generated"> </td></tr></thead><tbody><tr><td align="left"><a class="link" href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.containers" title="Containers">
|
||||
CONTAINERS</a></td><td align="left"><a class="link" href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.hashtable_too_small" title="Hashtable Too Small">
|
||||
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="link" href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.hashtable_too_large" title="Hashtable Too Large">
|
||||
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="link" href="profile_mode_diagnostics.html#manual.ext.profile_mode.analysis.inefficient_hash" title="Inefficient Hash">
|
||||
|
File diff suppressed because one or more lines are too long
@ -12,16 +12,16 @@
|
||||
</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions">Exceptions</a></span></dt><dd><dl><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.api">API Reference</a></span></dt><dt><span class="section"><a href="diagnostics.html#std.diagnostics.exceptions.data">Adding Data to <code class="classname">exception</code></a></span></dt></dl></dd><dt><span class="section"><a href="concept_checking.html">Concept Checking</a></span></dt></dl></dd><dt><span class="chapter"><a href="utilities.html">6.
|
||||
Utilities
|
||||
|
||||
</a></span></dt><dd><dl><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm140623072965760">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#idm140623072962208">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#idm140623072948912">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm140623071372480">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071349968">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071342672">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071328048">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm140623071311696">Examples</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071308112">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="strings.html">7.
|
||||
</a></span></dt><dd><dl><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm234604985488">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#idm234604981936">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#idm234604968640">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm234603392608">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#idm234603370096">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#idm234603362800">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#idm234603348176">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm234603331760">Examples</a></span></dt><dt><span class="section"><a href="memory.html#idm234603328176">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></dd><dt><span class="chapter"><a href="strings.html">7.
|
||||
Strings
|
||||
|
||||
</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="localization.html">8.
|
||||
Localization
|
||||
|
||||
</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#idm140623071106352">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="containers.html">9.
|
||||
</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales">Locales</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#std.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locales.locale.req">Requirements</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.design">Design</a></span></dt><dt><span class="section"><a href="localization.html#locales.locale.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="localization.html#locale.impl.c">Interacting with "C" locales</a></span></dt></dl></dd><dt><span class="section"><a href="localization.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="facets.html">Facets</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#std.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.ctype.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#idm234603126096">Specializations</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#std.localization.facet.codecvt">codecvt</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.design">Design</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#codecvt.design.wchar_t_size"><span class="type">wchar_t</span> Size</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.unicode">Support for Unicode</a></span></dt><dt><span class="section"><a href="facets.html#codecvt.design.issues">Other Issues</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#manual.localization.facet.messages">messages</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#facet.messages.req">Requirements</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.design">Design</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="facets.html#messages.impl.models">Models</a></span></dt><dt><span class="section"><a href="facets.html#messages.impl.gnu">The GNU Model</a></span></dt></dl></dd><dt><span class="section"><a href="facets.html#facet.messages.use">Use</a></span></dt><dt><span class="section"><a href="facets.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="chapter"><a href="containers.html">9.
|
||||
Containers
|
||||
|
||||
</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="iterators.html">10.
|
||||
</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#std.containers.sequences">Sequences</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="section"><a href="containers.html#containers.sequences.vector">vector</a></span></dt><dd><dl><dt><span class="section"><a href="containers.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="associative.html">Associative</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="associative.html#containers.associative.bitset">bitset</a></span></dt><dd><dl><dt><span class="section"><a href="associative.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="section"><a href="associative.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="unordered_associative.html">Unordered Associative</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.insert_hints">Insertion Hints</a></span></dt><dt><span class="section"><a href="unordered_associative.html#containers.unordered.hash">Hash Code</a></span></dt><dd><dl><dt><span class="section"><a href="unordered_associative.html#containers.unordered.cache">Hash Code Caching Policy</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="containers_and_c.html">Interacting with C</a></span></dt><dd><dl><dt><span class="section"><a href="containers_and_c.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="iterators.html">10.
|
||||
Iterators
|
||||
|
||||
</a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#std.iterators.predefined">Predefined</a></span></dt><dd><dl><dt><span class="section"><a href="iterators.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="section"><a href="iterators.html#iterators.predefined.end">One Past the End</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="algorithms.html">11.
|
||||
|
@ -6,7 +6,7 @@
|
||||
Standard Contents
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="localization.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.strings"></a>Chapter 7.
|
||||
Strings
|
||||
<a id="idm140623071281376" class="indexterm"></a>
|
||||
<a id="idm234603301312" class="indexterm"></a>
|
||||
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="strings.html#std.strings.string">String Classes</a></span></dt><dd><dl><dt><span class="section"><a href="strings.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.case">Case Sensitivity</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.character_types">Arbitrary Character Types</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.token">Tokenizing</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.shrink">Shrink to Fit</a></span></dt><dt><span class="section"><a href="strings.html#strings.string.Cstring">CString (MFC)</a></span></dt></dl></dd></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.strings.string"></a>String Classes</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="strings.string.simple"></a>Simple Transformations</h3></div></div></div><p>
|
||||
Here are Standard, simple, and portable ways to perform common
|
||||
transformations on a <code class="code">string</code> instance, such as
|
||||
|
@ -6,7 +6,7 @@
|
||||
Standard Contents
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="dynamic_memory.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.support"></a>Chapter 4.
|
||||
Support
|
||||
<a id="idm140623073140672" class="indexterm"></a>
|
||||
<a id="idm234605160352" class="indexterm"></a>
|
||||
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="support.html#std.support.types">Types</a></span></dt><dd><dl><dt><span class="section"><a href="support.html#std.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="section"><a href="support.html#std.support.types.numeric_limits">Numeric Properties</a></span></dt><dt><span class="section"><a href="support.html#std.support.types.null">NULL</a></span></dt></dl></dd><dt><span class="section"><a href="dynamic_memory.html">Dynamic Memory</a></span></dt><dt><span class="section"><a href="termination.html">Termination</a></span></dt><dd><dl><dt><span class="section"><a href="termination.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="section"><a href="termination.html#support.termination.verbose">Verbose Terminate Handler</a></span></dt></dl></dd></dl></div><p>
|
||||
This part deals with the functions called and objects created
|
||||
automatically during the course of a program's existence.
|
||||
@ -115,15 +115,15 @@
|
||||
overloading won't do what you expect. (This is why
|
||||
<span class="command"><strong>g++</strong></span> has a magic extension, so that
|
||||
<code class="constant">NULL</code> is always a pointer.)
|
||||
</p><p>In his book <a class="link" href="http://www.awprofessional.com/titles/0-201-92488-9/" target="_top"><span class="emphasis"><em>Effective
|
||||
C++</em></span></a>, Scott Meyers points out that the best way
|
||||
</p><p>In his book <a class="link" href="http://www.aristeia.com/books.html" target="_top"><span class="emphasis"><em>Effective
|
||||
C++</em></span></a>, Scott Meyers points out that the best way
|
||||
to solve this problem is to not overload on pointer-vs-integer
|
||||
types to begin with. He also offers a way to make your own magic
|
||||
<code class="constant">NULL</code> that will match pointers before it
|
||||
matches integers.
|
||||
</p><p>See
|
||||
<a class="link" href="http://www.awprofessional.com/titles/0-201-31015-5/" target="_top">the
|
||||
Effective C++ CD example</a>
|
||||
</p><p>See the
|
||||
<a class="link" href="http://www.aristeia.com/books.html" target="_top"><span class="emphasis"><em>Effective
|
||||
C++ CD</em></span></a> example.
|
||||
</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="std_contents.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="std_contents.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="dynamic_memory.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Part II.
|
||||
Standard Contents
|
||||
</td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Dynamic Memory</td></tr></table></div></body></html>
|
@ -492,7 +492,7 @@ only default variables.
|
||||
reporting functions including:
|
||||
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>time_counter</p></li><li class="listitem"><p>resource_counter</p></li><li class="listitem"><p>report_performance</p></li></ul></div></li></ul></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="test.special"></a>Special Topics</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="test.exception.safety"></a>
|
||||
Qualifying Exception Safety Guarantees
|
||||
<a id="idm140623064258560" class="indexterm"></a>
|
||||
<a id="idm234596242304" class="indexterm"></a>
|
||||
</h4></div></div></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="test.exception.safety.overview"></a>Overview</h5></div></div></div><p>
|
||||
Testing is composed of running a particular test sequence,
|
||||
and looking at what happens to the surrounding code when
|
||||
|
@ -2,13 +2,56 @@
|
||||
<!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>Unordered Associative</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="containers.html" title="Chapter 9. Containers" /><link rel="prev" href="associative.html" title="Associative" /><link rel="next" href="containers_and_c.html" title="Interacting with C" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Unordered Associative</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="associative.html">Prev</a> </td><th width="60%" align="center">Chapter 9.
|
||||
Containers
|
||||
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="containers_and_c.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.containers.unordered"></a>Unordered Associative</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="containers.unordered.hash"></a>Hash Code</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="containers.unordered.cache"></a>Hash Code Caching Policy</h4></div></div></div><p>
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="containers_and_c.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.containers.unordered"></a>Unordered Associative</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="containers.unordered.insert_hints"></a>Insertion Hints</h3></div></div></div><p>
|
||||
Here is how the hinting works in the libstdc++ implementation of unordered
|
||||
containers, and the rationale behind this behavior.
|
||||
</p><p>
|
||||
In the following text, the phrase <span class="emphasis"><em>equivalent to</em></span> refer
|
||||
to the result of the invocation of the equal predicate imposed on the
|
||||
container by its <code class="code">key_equal</code> object, which defaults to (basically)
|
||||
<span class="quote">“<span class="quote">==</span>”</span>.
|
||||
</p><p>
|
||||
Unordered containers can be seen as a <code class="code">std::vector</code> of
|
||||
<code class="code">std::forward_list</code>. The <code class="code">std::vector</code> represents
|
||||
the buckets and each <code class="code">std::forward_list</code> is the list of nodes
|
||||
belonging to the same bucket. When inserting an element in such a data
|
||||
structure we first need to compute the element hash code to find the
|
||||
bucket to insert the element to, the second step depends on the uniqueness
|
||||
of elements in the container.
|
||||
</p><p>
|
||||
In the case of <code class="code">std::unordered_set</code> and
|
||||
<code class="code">std::unordered_map</code> you need to look through all bucket's
|
||||
elements for an equivalent one. If there is none the insertion can be
|
||||
achieved, otherwise the insertion fails. As we always need to loop though
|
||||
all bucket's elements, the hint doesn't tell us if the element is already
|
||||
present, and we don't have any constraint on where the new element is to
|
||||
be inserted, the hint won't be of any help and will then be ignored.
|
||||
</p><p>
|
||||
In the case of <code class="code">std::unordered_multiset</code>
|
||||
and <code class="code">std::unordered_multimap</code> equivalent elements must be
|
||||
linked together so that the <code class="code">equal_range(const key_type&)</code>
|
||||
can return the range of iterators pointing to all equivalent elements.
|
||||
This is where hinting can be used to point to another equivalent element
|
||||
already part of the container and so skip all non equivalent elements of
|
||||
the bucket. So to be useful the hint shall point to an element equivalent
|
||||
to the one being inserted. The new element will be then inserted right
|
||||
after the hint. Note that because of an implementation detail inserting
|
||||
after a node can require updating the bucket of the following node. To
|
||||
check if the next bucket is to be modified we need to compute the
|
||||
following node's hash code. So if you want your hint to be really efficient
|
||||
it should be followed by another equivalent element, the implementation
|
||||
will detect this equivalence and won't compute next element hash code.
|
||||
</p><p>
|
||||
It is highly advised to start using unordered containers hints only if you
|
||||
have a benchmark that will demonstrate the benefit of it. If you don't then do
|
||||
not use hints, it might do more harm than good.
|
||||
</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="containers.unordered.hash"></a>Hash Code</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="containers.unordered.cache"></a>Hash Code Caching Policy</h4></div></div></div><p>
|
||||
The unordered containers in libstdc++ may cache the hash code for each
|
||||
element alongside the element itself. In some cases not recalculating
|
||||
the hash code every time it's needed can improve performance, but the
|
||||
additional memory overhead can also reduce performance, so whether an
|
||||
unordered associative container caches the hash code or not depends on
|
||||
a number of factors. The caching policy for GCC 4.8 is described below.
|
||||
the properties described below.
|
||||
</p><p>
|
||||
The C++ standard requires that <code class="code">erase</code> and <code class="code">swap</code>
|
||||
operations must not throw exceptions. Those operations might need an
|
||||
@ -18,22 +61,8 @@
|
||||
has a non-throwing exception specification such as <code class="code">noexcept</code>
|
||||
or <code class="code">throw()</code>.
|
||||
</p><p>
|
||||
Secondly, libstdc++ also needs the hash code in the implementation of
|
||||
<code class="code">local_iterator</code> and <code class="code">const_local_iterator</code> in
|
||||
order to know when the iterator has reached the end of the bucket.
|
||||
This means that the local iterator types will embed a copy of the hash
|
||||
function when possible.
|
||||
Because the local iterator types must be DefaultConstructible and
|
||||
CopyAssignable, if the hash function type does not model those concepts
|
||||
then it cannot be embedded and so the hash code must be cached.
|
||||
Note that a hash function might not be safe to use when
|
||||
default-constructed (e.g if it a function pointer) so a hash
|
||||
function that is contained in a local iterator won't be used until
|
||||
the iterator is valid, so the hash function has been copied from a
|
||||
correctly-initialized object.
|
||||
</p><p>
|
||||
If the hash function is non-throwing, DefaultConstructible and
|
||||
CopyAssignable then libstdc++ doesn't need to cache the hash code for
|
||||
If the hash function is non-throwing then libstdc++ doesn't need to
|
||||
cache the hash code for
|
||||
correctness, but might still do so for performance if computing a
|
||||
hash code is an expensive operation, as it may be for arbitrarily
|
||||
long strings.
|
||||
|
@ -10,5 +10,5 @@
|
||||
enumerated and detailed in the table below.
|
||||
</p><p>
|
||||
By default, <span class="command"><strong>g++</strong></span> is equivalent to <span class="command"><strong>g++ -std=gnu++98</strong></span>. The standard library also defaults to this dialect.
|
||||
</p><div class="table"><a id="idm140623073834816"></a><p class="title"><strong>Table 3.1. C++ Command Options</strong></p><div class="table-contents"><table summary="C++ Command Options" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Option Flags</th><th align="left">Description</th></tr></thead><tbody><tr><td align="left"><code class="literal">-std=c++98</code></td><td align="left">Use the 1998 ISO C++ standard plus amendments.</td></tr><tr><td align="left"><code class="literal">-std=gnu++98</code></td><td align="left">As directly above, with GNU extensions.</td></tr><tr><td align="left"><code class="literal">-std=c++11</code></td><td align="left">Use the 2011 ISO C++ standard.</td></tr><tr><td align="left"><code class="literal">-std=gnu++11</code></td><td align="left">As directly above, with GNU extensions.</td></tr><tr><td align="left"><code class="literal">-fexceptions</code></td><td align="left">See <a class="link" href="using_exceptions.html#intro.using.exception.no" title="Doing without">exception-free dialect</a></td></tr><tr><td align="left"><code class="literal">-frtti</code></td><td align="left">As above, but RTTI-free dialect.</td></tr><tr><td align="left"><code class="literal">-pthread</code> or <code class="literal">-pthreads</code></td><td align="left">For ISO C++11 <thread>, <future>,
|
||||
</p><div class="table"><a id="idm234605855552"></a><p class="title"><strong>Table 3.1. C++ Command Options</strong></p><div class="table-contents"><table summary="C++ Command Options" border="1"><colgroup><col align="left" class="c1" /><col align="left" class="c2" /></colgroup><thead><tr><th align="left">Option Flags</th><th align="left">Description</th></tr></thead><tbody><tr><td align="left"><code class="literal">-std=c++98</code></td><td align="left">Use the 1998 ISO C++ standard plus amendments.</td></tr><tr><td align="left"><code class="literal">-std=gnu++98</code></td><td align="left">As directly above, with GNU extensions.</td></tr><tr><td align="left"><code class="literal">-std=c++11</code></td><td align="left">Use the 2011 ISO C++ standard.</td></tr><tr><td align="left"><code class="literal">-std=gnu++11</code></td><td align="left">As directly above, with GNU extensions.</td></tr><tr><td align="left"><code class="literal">-fexceptions</code></td><td align="left">See <a class="link" href="using_exceptions.html#intro.using.exception.no" title="Doing without">exception-free dialect</a></td></tr><tr><td align="left"><code class="literal">-frtti</code></td><td align="left">As above, but RTTI-free dialect.</td></tr><tr><td align="left"><code class="literal">-pthread</code> or <code class="literal">-pthreads</code></td><td align="left">For ISO C++11 <thread>, <future>,
|
||||
<mutex>, or <condition_variable>.</td></tr><tr><td align="left"><code class="literal">-fopenmp</code></td><td align="left">For <a class="link" href="parallel_mode.html" title="Chapter 18. Parallel Mode">parallel</a> mode.</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="make.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="using_headers.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Make </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Headers</td></tr></table></div></body></html>
|
@ -265,7 +265,7 @@ is called.
|
||||
}
|
||||
catch(...)
|
||||
{ this->_M_setstate(ios_base::badbit); }
|
||||
</pre></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="using.exceptions.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="idm140623073242688"></a><p><span class="title"><em>
|
||||
</pre></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="using.exceptions.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="idm234605263488"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.opengroup.org/austin/" target="_top">
|
||||
System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008)
|
||||
</a>
|
||||
@ -274,39 +274,39 @@ is called.
|
||||
. </span><span class="copyright">Copyright © 2008
|
||||
The Open Group/The Institute of Electrical and Electronics
|
||||
Engineers, Inc.
|
||||
. </span></p></div><div class="biblioentry"><a id="idm140623073238992"></a><p><span class="title"><em>
|
||||
. </span></p></div><div class="biblioentry"><a id="idm234605259792"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.boost.org/community/error_handling.html" target="_top">
|
||||
Error and Exception Handling
|
||||
</a>
|
||||
</em>. </span><span class="author"><span class="firstname">David</span> <span class="surname">Abrahams </span>. </span><span class="publisher"><span class="publishername">
|
||||
Boost
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm140623073235296"></a><p><span class="title"><em>
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm234605256096"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.boost.org/community/exception_safety.html" target="_top">
|
||||
Exception-Safety in Generic Components
|
||||
</a>
|
||||
</em>. </span><span class="author"><span class="firstname">David</span> <span class="surname">Abrahams</span>. </span><span class="publisher"><span class="publishername">
|
||||
Boost
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm140623073231584"></a><p><span class="title"><em>
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm234605252384"></a><p><span class="title"><em>
|
||||
<a class="link" href="www.open-std.org/jtc1/sc22/wg21/docs/papers/1997/N1077.pdf" target="_top">
|
||||
Standard Library Exception Policy
|
||||
</a>
|
||||
</em>. </span><span class="author"><span class="firstname">Matt</span> <span class="surname">Austern</span>. </span><span class="publisher"><span class="publishername">
|
||||
WG21 N1077
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm140623073227872"></a><p><span class="title"><em>
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm234605248672"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://gcc.gnu.org/ml/gcc-patches/2001-03/msg00661.html" target="_top">
|
||||
ia64 c++ abi exception handling
|
||||
</a>
|
||||
</em>. </span><span class="author"><span class="firstname">Richard</span> <span class="surname">Henderson</span>. </span><span class="publisher"><span class="publishername">
|
||||
GNU
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm140623073224176"></a><p><span class="title"><em>
|
||||
. </span></span></p></div><div class="biblioentry"><a id="idm234605244976"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://www.research.att.com/~bs/3rd_safe.pdf" target="_top">
|
||||
Appendix E: Standard-Library Exception Safety
|
||||
</a>
|
||||
</em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span></p></div><div class="biblioentry"><a id="idm140623073221360"></a><p><span class="citetitle"><em class="citetitle">
|
||||
</em>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span></p></div><div class="biblioentry"><a id="idm234605242160"></a><p><span class="citetitle"><em class="citetitle">
|
||||
Exceptional C++
|
||||
</em>. </span><span class="pagenums">
|
||||
Exception-Safety Issues and Techniques
|
||||
. </span><span class="author"><span class="firstname">Herb</span> <span class="surname">Sutter</span>. </span></p></div><div class="biblioentry"><a id="idm140623073218976"></a><p><span class="title"><em>
|
||||
. </span><span class="author"><span class="firstname">Herb</span> <span class="surname">Sutter</span>. </span></p></div><div class="biblioentry"><a id="idm234605239776"></a><p><span class="title"><em>
|
||||
<a class="link" href="http://gcc.gnu.org/PR25191" target="_top">
|
||||
GCC Bug 25191: exception_defines.h #defines try/catch
|
||||
</a>
|
||||
|
File diff suppressed because one or more lines are too long
@ -6,8 +6,8 @@
|
||||
Standard Contents
|
||||
</th><td width="20%" align="right"> <a accesskey="n" href="pairs.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="std.util"></a>Chapter 6.
|
||||
Utilities
|
||||
<a id="idm140623073024128" class="indexterm"></a>
|
||||
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm140623072965760">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#idm140623072962208">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#idm140623072948912">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm140623071372480">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071349968">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071342672">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071328048">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm140623071311696">Examples</a></span></dt><dt><span class="section"><a href="memory.html#idm140623071308112">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.util.functors"></a>Functors</h2></div></div></div><p>If you don't know what functors are, you're not alone. Many people
|
||||
<a id="idm234605043792" class="indexterm"></a>
|
||||
</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="utilities.html#std.util.functors">Functors</a></span></dt><dt><span class="section"><a href="pairs.html">Pairs</a></span></dt><dt><span class="section"><a href="memory.html">Memory</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#std.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#allocator.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#allocator.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm234604985488">Interface Design</a></span></dt><dt><span class="section"><a href="memory.html#idm234604981936">Selecting Default Allocation Policy</a></span></dt><dt><span class="section"><a href="memory.html#idm234604968640">Disabling Memory Caching</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="section"><a href="memory.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="section"><a href="memory.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.auto_ptr">auto_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="section"><a href="memory.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#std.util.memory.shared_ptr">shared_ptr</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="section"><a href="memory.html#shared_ptr.impl">Implementation</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm234603392608">Class Hierarchy</a></span></dt><dt><span class="section"><a href="memory.html#idm234603370096">Thread Safety</a></span></dt><dt><span class="section"><a href="memory.html#idm234603362800">Selecting Lock Policy</a></span></dt><dt><span class="section"><a href="memory.html#idm234603348176">Related functions and classes</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.using">Use</a></span></dt><dd><dl><dt><span class="section"><a href="memory.html#idm234603331760">Examples</a></span></dt><dt><span class="section"><a href="memory.html#idm234603328176">Unresolved Issues</a></span></dt></dl></dd><dt><span class="section"><a href="memory.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="section"><a href="traits.html">Traits</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="std.util.functors"></a>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
|
||||
the wheel, we will refer you to the introduction to the functor
|
||||
concept written by SGI as part of their STL, in
|
||||
|
@ -263,8 +263,8 @@
|
||||
|
||||
<para>
|
||||
These settings can either be switched on in at the GDB command line,
|
||||
or put into a .gdbint file to establish default debugging
|
||||
characteristics, like so:
|
||||
or put into a <filename>.gdbinit</filename> file to establish default
|
||||
debugging characteristics, like so:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
@ -278,40 +278,26 @@
|
||||
|
||||
<para>
|
||||
Starting with version 7.0, GDB includes support for writing
|
||||
pretty-printers in Python. Pretty printers for STL classes are
|
||||
distributed with GCC from version 4.5.0. The most recent version of
|
||||
these printers are always found in libstdc++ svn repository.
|
||||
To enable these printers, check-out the latest printers to a local
|
||||
directory:
|
||||
pretty-printers in Python. Pretty printers for containers and other
|
||||
classes are distributed with GCC from version 4.5.0 and should be installed
|
||||
alongside the libstdc++ shared library files and found automatically by
|
||||
GDB.
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
Next, add the following section to your ~/.gdbinit The path must
|
||||
match the location where the Python module above was checked-out.
|
||||
So if checked out to: /home/maude/gdb_printers/, the path would be as
|
||||
written in the example below.
|
||||
Depending where libstdc++ is installed, GDB might refuse to auto-load
|
||||
the python printers and print a warning instead.
|
||||
If this happens the python printers can be enabled by following the
|
||||
instructions GDB gives for setting your <code>auto-load safe-path</code>
|
||||
in your <filename>.gdbinit</filename> configuration file.
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
python
|
||||
import sys
|
||||
sys.path.insert(0, '/home/maude/gdb_printers/python')
|
||||
from libstdcxx.v6.printers import register_libstdcxx_printers
|
||||
register_libstdcxx_printers (None)
|
||||
end
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
The path should be the only element that needs to be adjusted in the
|
||||
example. Once loaded, STL classes that the printers support
|
||||
Once loaded, standard library classes that the printers support
|
||||
should print in a more human-readable format. To print the classes
|
||||
in the old style, use the /r (raw) switch in the print command
|
||||
(i.e., print /r foo). This will print the classes as if the Python
|
||||
pretty-printers were not loaded.
|
||||
in the old style, use the <userinput>/r</userinput> (raw) switch in the
|
||||
print command (i.e., <userinput>print /r foo</userinput>). This will
|
||||
print the classes as if the Python pretty-printers were not loaded.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@ -332,8 +318,7 @@
|
||||
<para>
|
||||
The <link linkend="support.termination.verbose">verbose
|
||||
termination handler</link> gives information about uncaught
|
||||
exceptions which are killing the program. It is described in the
|
||||
linked-to page.
|
||||
exceptions which kill the program.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@ -347,14 +332,14 @@
|
||||
<section xml:id="debug.compile_time_checks"><info><title>Compile Time Checking</title></info>
|
||||
|
||||
<para> The <link linkend="manual.ext.compile_checks">Compile-Time
|
||||
Checks</link> Extension has compile-time checks for many algorithms.
|
||||
Checks</link> extension has compile-time checks for many algorithms.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section xml:id="debug.profile_mode" xreflabel="debug.profile_mode"><info><title>Profile-based Performance Analysis</title></info>
|
||||
|
||||
<para> The <link linkend="manual.ext.profile_mode">Profile-based
|
||||
Performance Analysis</link> Extension has performance checks for many
|
||||
Performance Analysis</link> extension has performance checks for many
|
||||
algorithms.
|
||||
</para>
|
||||
</section>
|
||||
|
@ -79,7 +79,7 @@ particular release.
|
||||
<entry>18.2</entry>
|
||||
<entry>Types</entry>
|
||||
<entry>Partial</entry>
|
||||
<entry>Missing offsetof, max_align_t</entry>
|
||||
<entry>Missing offsetof</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>18.3</entry>
|
||||
@ -999,10 +999,9 @@ particular release.
|
||||
<entry/>
|
||||
</row>
|
||||
<row>
|
||||
<?dbhtml bgcolor="#B0B0B0" ?>
|
||||
<entry>20.12</entry>
|
||||
<entry>Scoped allocator adaptor</entry>
|
||||
<entry>Partial</entry>
|
||||
<entry>Y</entry>
|
||||
<entry/>
|
||||
</row>
|
||||
<row>
|
||||
@ -1113,10 +1112,11 @@ particular release.
|
||||
<entry/>
|
||||
</row>
|
||||
<row>
|
||||
<?dbhtml bgcolor="#B0B0B0" ?>
|
||||
<entry>21.4</entry>
|
||||
<entry>Class template <code>basic_string</code></entry>
|
||||
<entry>Y</entry>
|
||||
<entry/>
|
||||
<entry>Partial</entry>
|
||||
<entry>Non-conforming Copy-On-Write implementation</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>21.5</entry>
|
||||
@ -2133,6 +2133,7 @@ particular release.
|
||||
Missing move and swap operations on <code>basic_ios</code>.
|
||||
Missing <code>io_errc</code> and <code>iostream_category</code>.
|
||||
<code>ios_base::failure</code> is not derived from <code>system_error</code>.
|
||||
Missing <code>ios_base::hexfloat</code>.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
|
Loading…
Reference in New Issue
Block a user