Makefile: Use more portable shell wildcard.
[official-gcc.git] / libstdc++-v3 / docs / html / explanations.html
blob7d8196ff84a00178c0239209111d254f103c7010
1 <html>
2 <head>
3 <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
4 <meta name="KEYWORDS" content="libstdc++, libstdc++-v3, GCC, g++" />
5 <meta name="DESCRIPTION" content="Explanatory notes about libstdc++-v3." />
6 <meta name="GENERATOR" content="vi and eight fingers" />
7 <title>Explanatory notes about libstdc++-v3 design</title>
8 <link rel="StyleSheet" href="lib3styles.css" />
9 </head>
10 <body>
12 <h1 class="centered"><a name="top">Explanatory notes about libstdc++-v3
13 design</a></h1>
15 <p>The latest version of this document is always available at
16 <a href="http://gcc.gnu.org/onlinedocs/libstdc++/explanations.html">
17 http://gcc.gnu.org/onlinedocs/libstdc++/explanations.html</a>.
18 </p>
20 <p>To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
21 </p>
24 <!-- ####################################################### -->
25 <hr />
26 <h3><a name="cstdio">&quot;I/O packages&quot;, <code>--enable-cstdio</code></a></h3>
27 <p>In addition to all the nifty things which C++ can do for I/O, its library
28 also includes all of the I/O capabilites of C. Making them work together
29 can be a challenge, not only
30 <a href="27_io/howto.html#8">for the programmer</a> but for the
31 implementors as well.
32 </p>
33 <p>There are two ways to do a C++ library: the cool way, and the easy way.
34 More specifically, the cool-but-easy-to-get-wrong way, and the
35 easy-to-guarantee-correct-behavior way. For 3.0, the easy way is used.
36 </p>
37 <p>Choosing 'stdio' is the easy way. It builds a C++ library which forwards
38 all operations to the C library. Many of the C++ I/O functions are
39 specified in the standard 'as if' they called a certain C function; the
40 easiest way to get it correct is to actually call that function. The
41 disadvantage is that the C++ code will run slower (fortunately, the layer
42 is thin).
43 </p>
44 <p>Choosing 'libio' is the cool way; it allows C++ and C to share some
45 buffers. It's disabled because of tricky synchronization issues. Other
46 cool ways (various methods of sharing resources between C and C++
47 facilities, instead of layering) are possible. This approach can speed
48 up I/O significantly.
49 </p>
50 <p>Other packages are possible. For a new package, a header must be
51 written to provide types like streamsize (usually just a typedef), as
52 well as some internal types like<code> __c_file_type </code> and
53 <code> __c_lock </code> (for the stdio case, these are FILE (as in
54 &quot;FILE*&quot;) and a simple POSIX mutex, respectively). An
55 interface class called <code> __basic_file </code> must also be filled in;
56 as an example, for the stdio case, these member functions are all
57 inline calles to fread, fwrite, etc.
58 </p>
59 <p>Return <a href="#top">to the top of the page</a> or
60 <a href="http://gcc.gnu.org/libstdc++/">to the homepage</a>.
61 </p>
64 <hr />
65 <h3><a name="alloc">Internal Allocators</a></h3>
66 <p>
67 </p>
68 <p>Return <a href="#top">to the top of the page</a> or
69 <a href="http://gcc.gnu.org/libstdc++/">to the homepage</a>.
70 </p>
73 <!-- ####################################################### -->
75 <hr />
76 <p class="fineprint"><em>
77 See <a href="17_intro/license.html">license.html</a> for copying conditions.
78 Comments and suggestions are welcome, and may be sent to
79 <a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
80 </em></p>
83 </body>
84 </html>