mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-27 17:05:37 +08:00
ba43f4ebc4
2002-10-07 Jonathan Wakely <jw@kayari.org> * docs/html/configopts.html, docs/html/documentation.html, docs/html/explanations.html, docs/html/install.html, docs/html/17_intro/contribute.html, docs/html/17_intro/howto.html, docs/html/17_intro/license.html, docs/html/18_support/howto.html, docs/html/19_diagnostics/howto.html, docs/html/20_util/howto.html, docs/html/21_strings/howto.html, docs/html/22_locale/codecvt.html, docs/html/22_locale/ctype.html, docs/html/22_locale/howto.html, docs/html/22_locale/locale.html, docs/html/22_locale/messages.html, docs/html/23_containers/howto.html, docs/html/24_iterators/howto.html, docs/html/25_algorithms/howto.html, docs/html/26_numerics/howto.html, docs/html/27_io/howto.html, docs/html/ext/howto.html, docs/html/ext/sgiexts.html, docs/html/faq/index.html: Add DOCTYPEs. From-SVN: r57903
90 lines
3.5 KiB
HTML
90 lines
3.5 KiB
HTML
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
<!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" xml:lang="en" lang="en">
|
|
<head>
|
|
<meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
|
|
<meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++" />
|
|
<meta name="DESCRIPTION" content="Explanatory notes about libstdc++-v3." />
|
|
<meta name="GENERATOR" content="vi and eight fingers" />
|
|
<title>Explanatory notes about libstdc++-v3 design</title>
|
|
<link rel="StyleSheet" href="lib3styles.css" />
|
|
</head>
|
|
<body>
|
|
|
|
<h1 class="centered"><a name="top">Explanatory notes about libstdc++-v3
|
|
design</a></h1>
|
|
|
|
<p>The latest version of this document is always available at
|
|
<a href="http://gcc.gnu.org/onlinedocs/libstdc++/explanations.html">
|
|
http://gcc.gnu.org/onlinedocs/libstdc++/explanations.html</a>.
|
|
</p>
|
|
|
|
<p>To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
|
|
</p>
|
|
|
|
|
|
<!-- ####################################################### -->
|
|
<hr />
|
|
<h3><a name="cstdio">"I/O packages", <code>--enable-cstdio</code></a></h3>
|
|
<p>In addition to all the nifty things which C++ can do for I/O, its library
|
|
also includes all of the I/O capabilites of C. Making them work together
|
|
can be a challenge, not only
|
|
<a href="27_io/howto.html#8">for the programmer</a> but for the
|
|
implementors as well.
|
|
</p>
|
|
<p>There are two ways to do a C++ library: the cool way, and the easy way.
|
|
More specifically, the cool-but-easy-to-get-wrong way, and the
|
|
easy-to-guarantee-correct-behavior way. For 3.0, the easy way is used.
|
|
</p>
|
|
<p>Choosing 'stdio' is the easy way. It builds a C++ library which forwards
|
|
all operations to the C library. Many of the C++ I/O functions are
|
|
specified in the standard 'as if' they called a certain C function; the
|
|
easiest way to get it correct is to actually call that function. The
|
|
disadvantage is that the C++ code will run slower (fortunately, the layer
|
|
is thin).
|
|
</p>
|
|
<p>Choosing 'libio' is the cool way; it allows C++ and C to share some
|
|
buffers. It's disabled because of tricky synchronization issues. Other
|
|
cool ways (various methods of sharing resources between C and C++
|
|
facilities, instead of layering) are possible. This approach can speed
|
|
up I/O significantly.
|
|
</p>
|
|
<p>Other packages are possible. For a new package, a header must be
|
|
written to provide types like streamsize (usually just a typedef), as
|
|
well as some internal types like<code> __c_file_type </code> and
|
|
<code> __c_lock </code> (for the stdio case, these are FILE (as in
|
|
"FILE*") and a simple POSIX mutex, respectively). An
|
|
interface class called <code> __basic_file </code> must also be filled in;
|
|
as an example, for the stdio case, these member functions are all
|
|
inline calles to fread, fwrite, etc.
|
|
</p>
|
|
<p>Return <a href="#top">to the top of the page</a> or
|
|
<a href="http://gcc.gnu.org/libstdc++/">to the homepage</a>.
|
|
</p>
|
|
|
|
|
|
<hr />
|
|
<h3><a name="alloc">Internal Allocators</a></h3>
|
|
<p>
|
|
</p>
|
|
<p>Return <a href="#top">to the top of the page</a> or
|
|
<a href="http://gcc.gnu.org/libstdc++/">to the homepage</a>.
|
|
</p>
|
|
|
|
|
|
<!-- ####################################################### -->
|
|
|
|
<hr />
|
|
<p class="fineprint"><em>
|
|
See <a href="17_intro/license.html">license.html</a> for copying conditions.
|
|
Comments and suggestions are welcome, and may be sent to
|
|
<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
|
|
</em></p>
|
|
|
|
|
|
</body>
|
|
</html>
|