xref: /openbsd-src/gnu/lib/libstdc++/libstdc++/docs/html/explanations.html (revision 03a78d155d6fff5698289342b62759a75b20d130)
1*03a78d15Sespie<?xml version="1.0" encoding="ISO-8859-1"?>
2*03a78d15Sespie<!DOCTYPE html
3*03a78d15Sespie          PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4*03a78d15Sespie          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5*03a78d15Sespie
6*03a78d15Sespie<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7*03a78d15Sespie<head>
8*03a78d15Sespie   <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
9*03a78d15Sespie   <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++" />
10*03a78d15Sespie   <meta name="DESCRIPTION" content="Explanatory notes about libstdc++-v3." />
11*03a78d15Sespie   <meta name="GENERATOR" content="vi and eight fingers" />
12*03a78d15Sespie   <title>Explanatory notes about libstdc++-v3 design</title>
13*03a78d15Sespie<link rel="StyleSheet" href="lib3styles.css" />
14*03a78d15Sespie</head>
15*03a78d15Sespie<body>
16*03a78d15Sespie
17*03a78d15Sespie<h1 class="centered"><a name="top">Explanatory notes about libstdc++-v3
18*03a78d15Sespiedesign</a></h1>
19*03a78d15Sespie
20*03a78d15Sespie<p class="fineprint"><em>
21*03a78d15Sespie   The latest version of this document is always available at
22*03a78d15Sespie   <a href="http://gcc.gnu.org/onlinedocs/libstdc++/explanations.html">
23*03a78d15Sespie   http://gcc.gnu.org/onlinedocs/libstdc++/explanations.html</a>.
24*03a78d15Sespie</em></p>
25*03a78d15Sespie
26*03a78d15Sespie<p><em>
27*03a78d15Sespie   To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
28*03a78d15Sespie</em></p>
29*03a78d15Sespie
30*03a78d15Sespie
31*03a78d15Sespie<!-- ####################################################### -->
32*03a78d15Sespie<hr />
33*03a78d15Sespie<h3><a name="cstdio">&quot;I/O packages&quot;, <code>--enable-cstdio</code></a></h3>
34*03a78d15Sespie<p>In addition to all the nifty things which C++ can do for I/O, its library
35*03a78d15Sespie   also includes all of the I/O capabilites of C.  Making them work together
36*03a78d15Sespie   can be a challenge, not only
37*03a78d15Sespie   <a href="27_io/howto.html#8">for the programmer</a> but for the
38*03a78d15Sespie   implementors as well.
39*03a78d15Sespie</p>
40*03a78d15Sespie<p>There are two ways to do a C++ library:  the cool way, and the easy way.
41*03a78d15Sespie   More specifically, the cool-but-easy-to-get-wrong way, and the
42*03a78d15Sespie   easy-to-guarantee-correct-behavior way.  For 3.0, the easy way is used.
43*03a78d15Sespie</p>
44*03a78d15Sespie<p>Choosing 'stdio' is the easy way.  It builds a C++ library which forwards
45*03a78d15Sespie   all operations to the C library.  Many of the C++ I/O functions are
46*03a78d15Sespie   specified in the standard 'as if' they called a certain C function; the
47*03a78d15Sespie   easiest way to get it correct is to actually call that function.  The
48*03a78d15Sespie   disadvantage is that the C++ code will run slower (fortunately, the layer
49*03a78d15Sespie   is thin).
50*03a78d15Sespie</p>
51*03a78d15Sespie<p>Other packages are possible.  For a new package, a header must be
52*03a78d15Sespie   written to provide types like streamsize (usually just a typedef), as
53*03a78d15Sespie   well as some internal types like<code> __c_file_type </code> and
54*03a78d15Sespie   <code> __c_lock </code> (for the stdio case, these are FILE (as in
55*03a78d15Sespie   &quot;FILE*&quot;) and a simple POSIX mutex, respectively).  An
56*03a78d15Sespie   interface class called <code> __basic_file </code> must also be filled in;
57*03a78d15Sespie   as an example, for the stdio case, these member functions are all
58*03a78d15Sespie   inline calles to fread, fwrite, etc.
59*03a78d15Sespie</p>
60*03a78d15Sespie<p>Return <a href="#top">to the top of the page</a> or
61*03a78d15Sespie   <a href="http://gcc.gnu.org/libstdc++/">to the homepage</a>.
62*03a78d15Sespie</p>
63*03a78d15Sespie
64*03a78d15Sespie
65*03a78d15Sespie<hr />
66*03a78d15Sespie<h3><a name="alloc">Internal Allocators</a></h3>
67*03a78d15Sespie<p>
68*03a78d15Sespie</p>
69*03a78d15Sespie<p>Return <a href="#top">to the top of the page</a> or
70*03a78d15Sespie   <a href="http://gcc.gnu.org/libstdc++/">to the homepage</a>.
71*03a78d15Sespie</p>
72*03a78d15Sespie
73*03a78d15Sespie
74*03a78d15Sespie<!-- ####################################################### -->
75*03a78d15Sespie
76*03a78d15Sespie<hr />
77*03a78d15Sespie<p class="fineprint"><em>
78*03a78d15SespieSee <a href="17_intro/license.html">license.html</a> for copying conditions.
79*03a78d15SespieComments and suggestions are welcome, and may be sent to
80*03a78d15Sespie<a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
81*03a78d15Sespie</em></p>
82*03a78d15Sespie
83*03a78d15Sespie
84*03a78d15Sespie</body>
85*03a78d15Sespie</html>
86