2001-10-04 Phil Edwards <pme@gcc.gnu.org>
[official-gcc.git] / libstdc++-v3 / docs / html / faq / index.html
blob813c54cd9059fdea8ddcbbddc75f67fc1f857d9d
1 <html>
2 <head>
3 <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
4 <meta NAME="KEYWORDS" CONTENT="libstdc++, libstdc++-v3, GCC, g++, libg++, STL">
5 <meta NAME="DESCRIPTION" CONTENT="FAQ for the GNU libstdc++ effort.">
6 <title>libstdc++-v3 FAQ</title>
7 <link REL=StyleSheet HREF="../lib3styles.css">
8 <!--
9 ** Locations of "the most recent snapshot is the Nth" text are
10 ** answers 1_1, 1_4, 4_1, 5_6.
11 -->
12 </head>
13 <body>
15 <h1 CLASS="centered">libstdc++ Frequently Asked Questions</h1>
17 <p>The latest version of this document is always available at
18 <a href="http://gcc.gnu.org/onlinedocs/libstdc++/faq/">
19 http://gcc.gnu.org/onlinedocs/libstdc++/faq/</a>.</p>
21 <p>To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
23 <!-- ####################################################### -->
24 <hr>
25 <h1>Questions</h1>
26 <ol>
27 <li><a href="#1_0">General Information</a>
28 <!-- I suspect these will mostly be links to/into existing documents. -->
29 <ol>
30 <li><a href="#1_1">What is libstdc++-v3?</a>
31 <li><a href="#1_2">Why should I use libstdc++?</a>
32 <li><a href="#1_3">Who's in charge of it?</a>
33 <li><a href="#1_4">How do I get libstdc++?</a>
34 <li><a href="#1_5">When is libstdc++ going to be finished?</a>
35 <li><a href="#1_6">How do I contribute to the effort?</a>
36 <li><a href="#1_7">What happened to libg++? I need that!</a>
37 <li><a href="#1_8">What if I have more questions?</a>
38 <li><a href="#1_9">What are the license terms for libstdc++-v3?</a>
39 </ol>
41 <li><a href="#2_0">Installation</a>
42 <ol>
43 <li><a href="#2_1">How do I install libstdc++-v3?</a>
44 <li><a href="#2_2">[removed]</a>
45 <li><a href="#2_3">What is this CVS thing that you keep
46 mentioning?</a>
47 <li><a href="#2_4">How do I know if it works?</a>
48 </ol>
50 <li><a href="#3_0">Platform-Specific Issues</a>
51 <ol>
52 <li><a href="#3_1">Can libstdc++-v3 be used with &lt;my
53 favorite compiler&gt;?</a>
54 <li><a href="#3_2">[removed]</a>
55 <li><a href="#3_3">Building under DEC OSF kills the assembler</a>
56 </ol>
58 <li><a href="#4_0">Known Bugs and Non-Bugs</a>
59 <ol>
60 <li><a href="#4_1">What works already?</a>
61 <li><a href="#4_2">Bugs in gcc/g++ (not libstdc++-v3)</a>
62 <li><a href="#4_3">Bugs in the C++ language/lib specification</a>
63 <li><a href="#4_4">Things in libstdc++ that look like bugs</a>
64 <ul>
65 <li><a href="#4_4_Weff">-Weffc++ complains too much</a>
66 <li><a href="#4_4_rel_ops">&quot;ambiguous overloads&quot;
67 after including an old-style header</a>
68 <li><a href="#4_4_interface">The g++-3 headers are
69 <strong>not ours</strong></a>
70 <li><a href="#4_4_glibc">compilation errors from streambuf.h</a>
71 <li><a href="#4_4_checks">errors about <em>*Cconcept</em> and
72 <em>constraints</em> in the STL...</a>
73 </ul>
74 <li><a href="#4_5">Aw, that's easy to fix!</a>
75 </ol>
77 <li><a href="#5_0">Miscellaneous</a>
78 <ol>
79 <li><a href="#5_1">string::iterator is not char*;
80 vector&lt;T&gt;::iterator is not T*</a>
81 <li><a href="#5_2">What's next after libstdc++-v3?</a>
82 <li><a href="#5_3">What about the STL from SGI?</a>
83 <li><a href="#5_4">Extensions and Backward Compatibility</a>
84 <li><a href="#5_5">[removed]</a>
85 <li><a href="#5_6">Is libstdc++-v3 thread-safe?</a>
86 <li><a href="#5_7">How do I get a copy of the ISO C++ Standard?</a>
87 </ol>
89 </ol>
91 <hr>
93 <!-- ####################################################### -->
95 <h1><a name="1_0">1.0 General Information</a></h1>
96 <!-- I suspect these will mostly be links to/into existing documents. -->
97 <h2><a name="1_1">1.1 What is libstdc++-v3?</a></h2>
98 <p>The GNU Standard C++ Library v3, or libstdc++-2.9x, is an
99 ongoing project to implement the ISO 14882 Standard C++ library
100 as described in chapters 17 through 27 and annex D. As the
101 library reaches stable plateaus, it is captured in a snapshot
102 and released. The current release is <A
103 HREF="ftp://gcc.gnu.org/pub/libstdc++/libstdc++-2.92.tar.gz">the
104 eleventh snapshot</a>. For those who want to see exactly how
105 far the project has come, or just want the latest
106 bleeding-edge code, the up-to-date source is available over
107 anonymous CVS, and can even be browsed over the Web (see below).
108 </p>
109 <p>A more formal description of the V3 goals can be found in the
110 official <a href="../17_intro/DESIGN">design document</a>.
111 </p>
113 <hr>
114 <h2><a name="1_2">1.2 Why should I use libstdc++?</a></h2>
115 <p>The completion of the ISO C++ standardization gave the
116 C++ community a powerful set of reuseable tools in the form
117 of the C++ Standard Library. However, all existing C++
118 implementations are (as the Draft Standard used to say)
119 &quot;incomplet and incorrekt,&quot; and many suffer from
120 limitations of the compilers that use them.
121 </p>
122 <p>The GNU C/C++/FORTRAN/&lt;pick-a-language&gt; compiler
123 (<code>gcc</code>, <code>g++</code>, etc) is widely considered to be
124 one of the leading compilers in the world. Its development
125 has recently been taken over by the
126 <a href="http://gcc.gnu.org/">GCC team</a>. All of
127 the rapid development and near-legendary
129 HREF="http://gcc.gnu.org/gcc-2.95/buildstat.html">portability</a>
130 that are the hallmarks of an open-source project are being
131 applied to libstdc++.
132 </p>
133 <p>That means that all of the Standard classes and functions
134 (such as <code>string</code>, <code>vector&lt;&gt;</code>, iostreams,
135 and algorithms) will be freely available and fully compliant.
136 Programmers will no longer need to &quot;roll their own&quot;
137 nor be worried about platform-specific incompatabilities.
138 </p>
140 <hr>
141 <h2><a name="1_3">1.3 Who's in charge of it?</a></h2>
142 <p>The libstdc++ project is contributed to by several developers
143 all over the world, in the same way as GCC or Linux.
144 Benjamin Kosnik, Gabriel Dos Reis, Phil Edwards, and Ulrich
145 Drepper are the lead maintainers of the CVS archive.
146 </p>
147 <p>Development and discussion is held on the libstdc++ mailing
148 list. Subscribing to the list, or searching the list
149 archives, is open to everyone. You can read instructions for
150 doing so on the <a href="http://gcc.gnu.org/libstdc++/">homepage</a>.
151 If you have questions, ideas, code, or are just curious, sign up!
152 </p>
154 <hr>
155 <h2><a name="1_4">1.4 How do I get libstdc++?</a></h2>
156 <p>The eleventh (and latest) snapshot of libstdc++-v3 is <A
157 HREF="ftp://gcc.gnu.org/pub/libstdc++/libstdc++-2.92.tar.gz">
158 available via ftp</a>.
159 </p>
160 <p>The <a href="http://gcc.gnu.org/libstdc++/">homepage</a>
161 has instructions for retrieving the latest CVS sources, and for
162 browsing the CVS sources over the web.
163 </p>
164 <p>The subset commonly known as the Standard Template Library
165 (chapters 23 through 25, mostly) is adapted from the SGI STL,
166 which is also an ongoing work.<!-- Possibly a link to SGI's
167 STL here. -->
168 </p>
170 <hr>
171 <h2><a name="1_5">1.5 When is libstdc++ going to be finished?</a></h2>
172 <!-- <p>Nathan Myers gave the best of all possible answers in <A
173 HREF="http://www.deja.com/getdoc.xp?AN=469581698&fmt=text">a
174 Usenet article</a>.</p>
175 which is no longer available, thanks deja...-->
176 <p>Nathan Myers gave the best of all possible answers, responding to a
177 Usenet article asking this question: <em>Sooner, if you help.</em>
178 </p>
181 <hr>
182 <h2><a name="1_6">1.6 How do I contribute to the effort?</a></h2>
183 <p>Here is <a href="../17_intro/contribute.html">a
184 page devoted to this topic</a>. Subscribing to the mailing
185 list (see above, or the homepage) is a very good idea if you
186 have something to contribute, or if you have spare time and
187 want to help. Contributions don't have to be in the form of
188 source code; anybody who is willing to help write
189 documentation, for example, or has found a bug in code that
190 we all thought was working, is more than welcome!
191 </p>
193 <hr>
194 <h2><a name="1_7">1.7 What happened to libg++? I need that!</a></h2>
195 <p>The most recent libg++ README states that libg++ is no longer
196 being actively maintained. It should not be used for new
197 projects, and is only being kicked along to support older code.
198 </p>
199 <p>The libg++ was designed and created when there was no Standard
200 to provide guidance. Classes like linked lists are now provided
201 for by <code>list&lt;T&gt;</code> and do not need to be created by
202 <code>genclass</code>. (For that matter, templates exist now and
203 are well-supported, whereas genclass (mostly) predates them.)
204 </p>
205 <p>There are other classes in libg++ that are not specified in the
206 ISO Standard (e.g., statistical analysis). While there are a
207 lot of really useful things that are used by a lot of people
208 (e.g., statistics :-), the Standards Committee couldn't include
209 everything, and so a lot of those &quot;obvious&quot; classes
210 didn't get included.
211 </p>
212 <p>Since libstdc++ is an implementation of the Standard Library, we
213 have no plans at this time to include non-Standard utilities
214 in the implementation, however handy they are. (The extensions
215 provided in the SGI STL aren't maintained by us and don't get
216 a lot of our attention, because they don't require a lot of our
217 time.) It is entirely plausable that the &quot;useful stuff&quot;
218 from libg++ might be extracted into an updated utilities library,
219 but nobody has stated such a project yet.
220 </p>
221 <!-- The advertisement, so to speak, might have to go. Hmmmmm. -->
222 <p>(The <a href="http://www.boost.org/">Boost</a> site houses free
223 C++ libraries that do varying things, and happened to be started
224 by members of the Standards Committee. Certain &quot;useful
225 stuff&quot; classes will probably migrate there.)
226 </p>
227 <p>For the bold and/or desperate, the
228 <a href="http://gcc.gnu.org/fom_serv/cache/33.html">GCC FAQ</a>
229 describes where to find the last libg++ source.
230 </p>
232 <hr>
233 <h2><a name="1_8">1.8 What if I have more questions?</a></h2>
234 <p>If you have read the README and RELEASE-NOTES files, and your
235 question remains unanswered, then just ask the mailing list.
236 At present, you do not need to be subscribed to the list to
237 send a message to it. More information is available on the
238 homepage (including how to browse the list archives); to send
239 to the list, use <a href="mailto:libstdc++@gcc.gnu.org">
240 <CODE>libstdc++@gcc.gnu.org</CODE></a>.
241 </p>
242 <p>If you have a question that you think should be included here,
243 or if you have a question <em>about</em> a question/answer here,
244 contact <a href="mailto:pme@gcc.gnu.org">Phil Edwards</a>
245 or <a href="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</a>.
246 </p>
248 <hr>
249 <h2><a name="1_9">1.9 What are the license terms for libstdc++-v3?</a></h2>
250 <p>See <a href="../17_intro/license.html">our license description</a>
251 for these and related questions.
252 </p>
254 <hr>
255 <h1><a name="2_0">2.0 Installation</a></h1>
256 <h2><a name="2_1">2.1 How do I install libstdc++-v3?</a></h2>
257 <p>Complete instructions are not given here (this is a FAQ, not
258 an installation document), but the tools required are few:
259 </p>
260 <ul>
261 <li> A 3.x release of GCC. Note that building GCC is much
262 easier and more automated than building the GCC 2.[78]
263 series was. If you are using GCC 2.95, you can still
264 build earlier snapshots of libstdc++.
265 <li> GNU Make is recommended, but should not be required.
266 <li> The GNU Autotools are needed if you are messing with
267 the configury or makefiles.
268 </ul>
269 <p>The file <a href="../documentation.html">documentation.html</a>
270 provides a good overview of the steps necessary to build, install,
271 and use the library. Instructions for configuring the library
272 with new flags such as --enable-threads are there also, as well as
273 patches and instructions for working with GCC 2.95.
274 </p>
275 <p>The top-level install.html and
276 <a href="../17_intro/RELEASE-NOTES">RELEASE-NOTES</a> files contain
277 the exact build and installation instructions. You may wish to
278 browse those files over CVSweb ahead of time to get a feel for
279 what's required. RELEASE-NOTES is located in the
280 &quot;.../docs/17_intro/&quot; directory of the distribution.
281 </p>
283 <hr>
284 <h2><a name="2_2">2.2 [removed]</a></h2>
285 <p>This question has become moot and has been removed. The stub
286 is here to preserve numbering (and hence links/bookmarks).
287 </p>
289 <hr>
290 <h2><a name="2_3">2.3 What is this CVS thing that you
291 keep mentioning?</a></h2>
292 <p>The <em>Concurrent Versions System</em> is one of several revision
293 control packages. It was selected for GNU projects because it's
294 free (speech), free (beer), and very high quality. The <A
295 HREF="http://www.gnu.org/software/cvs/cvs.html">CVS entry in
296 the GNU software catalogue</a> has a better description as
297 well as a
298 <a href="http://www.cvshome.org/">link to the makers of CVS</a>.
299 </p>
300 <p>The &quot;anonymous client checkout&quot; feature of CVS is
301 similar to anonymous FTP in that it allows anyone to retrieve
302 the latest libstdc++ sources.
303 </p>
304 <p>After the first of April, American users will have a
305 &quot;/pharmacy&quot; command-line option...
306 <!-- wonder how long that'll live -->
307 </p>
309 <hr>
310 <h2><a name="2_4">2.4 How do I know if it works?</a></h2>
311 <p>libstdc++-v3 comes with its own testsuite. You do not need
312 to actually install the library (&quot;<code>make
313 install</code>&quot;) to run the testsuite.
314 </p>
315 <p>To run the testsuite on the library after building it, use
316 &quot;make check&quot; while in your build directory. To run
317 the testsuite on the library after building and installing it,
318 use &quot;make check-install&quot; instead.
319 </p>
320 <p>If you find bugs in the testsuite programs themselves, or if
321 you think of a new test program that should be added to the
322 suite, <B>please</B> write up your idea and send it to the list!
323 </p>
325 <hr>
326 <h1><a name="3_0">3.0 Platform-Specific Issues</a></h1>
327 <h2><a name="3_1">3.1 Can libstdc++-v3 be used with &lt;my
328 favorite compiler&gt;?</a></h2>
329 <p>Probably not. Yet.</p>
330 <p>Because GCC advances so rapidly, development and testing of
331 libstdc++ is being done almost entirely under that compiler.
332 If you are curious about whether other, lesser compilers
333 (*grin*) support libstdc++, you are more than welcome to try.
334 Configuring and building the library (see above) will still
335 require certain tools, however. Also keep in mind that
336 <em>building</em> libstdc++ does not imply that your compiler
337 will be able to <em>use</em> all of the features found in the
338 C++ Standard Library.
339 </p>
340 <p>Since the goal of ISO Standardization is for all C++
341 implementations to be able to share code, the final libstdc++
342 should, in theory, be useable under any ISO-compliant
343 compiler. It will still be targeted and optimized for
344 GCC/g++, however.
345 </p>
347 <hr>
348 <h2><a name="3_2">3.2 [removed]</a></h2>
349 <p>This question has become moot and has been removed. The stub
350 is here to preserve numbering (and hence links/bookmarks).
351 </p>
353 <hr>
354 <h2><a name="3_3">3.3 Building DEC OSF kills the assembler</a></h2>
355 <p>The <code>atomicity.h</code> header for the Alpha processor
356 currently uses pseudo-operators which the DEC assembler
357 doesn't understand (in particular, .subsection and .previous).
358 The simple solution is to install GNU <code>as</code> and arrange
359 for the GCC build to use it (or merge the sources and build
360 it during the bootstrap).
361 </p>
362 <p>Anyone who
363 <a href="http://gcc.gnu.org/ml/libstdc++/2000-12/msg00279.html">knows
364 the DEC assembler well enough</a> to provide the equivalent of
365 these two pseudos would win praise and accolades from many.
366 </p>
369 <hr>
370 <h1><a name="4_0">4.0 Known Bugs and Non-Bugs</a></h1>
371 <em>Note that this section can get rapdily outdated -- such is the
372 nature of an open-source project. For the latest information, join
373 the mailing list or look through recent archives. The RELEASE-
374 NOTES and BUGS files are generally kept up-to-date.</em>
376 <p>For 3.0.1, the most common &quot;bug&quot; is an apparently missing
377 &quot;<code>../</code>&quot; in include/Makefile, resulting in files
378 like gthr.h and gthr-single.h not being found.
379 </p>
380 <p>Please read
381 <a href="http://gcc.gnu.org/install/configure.html">the configuration
382 instructions for GCC</a>,
383 specifically the part about configuring in a seperate build directory,
384 and how strongly recommended it is. Building in the source directory
385 is fragile, is rarely tested, and tends to break, as in this case.
386 Work has already gone into the source tree to make this less painful
387 for the next release.
388 </p>
389 <p><strong>Please do not report this as a bug. We know about it.</strong>
390 Reporting this -- or any other problem that's already been fixed --
391 hinders the development of GCC, because we have to take time to
392 respond to your report. Thank you.
393 </p>
395 <h2><a name="4_1">4.1 What works already?</a></h2>
396 <p>This is a verbatim clip from the &quot;Status&quot; section
397 of the RELEASE-NOTES for the latest snapshot.
398 </p>
400 <!-- Yeah, I meant that "verbatim clip" thing literally... :-) -->
402 <pre>
403 New:
405 - preliminary doxygen documentation has been added. Running &quot;make
406 doxygen&quot; in the libstdc++-v3 build directory will generate HTML
407 documentation that can be used to cross-reference names and files in
408 the library.
409 - a dejagnu based testing framework has been added
410 - a new implementation of the concept checking code has been ported
411 from the boost libraries.
412 - support for -fno-exceptions has been added
413 - stdexcept was re-written
414 - using deprecated or antiquated headers now gives a warning
415 - the stdio interface to iostreams has been tweaked, and now works
416 with synchronized c/c++ io
417 - new libsupc++ routines implementing the IA-64 C++ ABI.
418 - HPUX configuration files
419 - support for AIX added
420 - a lot of bugs were fixed.
421 - preliminary named locales implemented
422 - portability improvements made to generation of &lt;limits&gt;
423 - speedups to improve configuration time.
424 - DJGPP support added.
425 - support for dlopening shared libstdc++
426 </pre>
429 <hr>
430 <h2><a name="4_2">4.2 Bugs in gcc/g++ (not libstdc++-v3)</a></h2>
431 <p>This is by no means meant to be complete nor exhaustive, but
432 mentions some problems that users may encounter when building
433 or using libstdc++. If you are experiencing one of these
434 problems, you can find more information on the libstdc++ and
435 the GCC mailing lists.
436 </p>
437 <ul>
438 <li>As of 2.91, these bugs have all been fixed. We look forward
439 to new ones, well, not exactly...
440 </ul>
442 <hr>
443 <h2><a name="4_3">4.3 Bugs in the C++ language/lib specification</a></h2>
444 <p>Yes, unfortunately, there are some. In a <A
445 HREF="http://gcc.gnu.org/ml/libstdc++/1998/msg00006.html">message
446 to the list</a>, Nathan Myers announced that he has started a list of
447 problems in the ISO C++ Standard itself, especially with
448 regard to the chapters that concern the library. The list
449 itself is <A
450 HREF="http://www.cantrip.org/draft-bugs.txt">posted on his
451 website</a>. Developers who are having problems interpreting
452 the Standard may wish to consult his notes.
453 </p>
454 <p>For those people who are not part of the ISO Library Group
455 (i.e., nearly all of us needing to read this page in the first
456 place :-), a public list of the library defects is occasionally
457 published <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/">here</a>.
458 </p>
460 <hr>
461 <h2><a name="4_4">4.4 Things in libstdc++ that look like bugs</a></h2>
462 <p>There are things which are not bugs in the compiler (4.2) nor
463 the language specification (4.3), but aren't really bugs in
464 libstdc++, either. Really! Please do not report these as bugs.
465 </p>
466 <a name="4_4_Weff">
467 <p><strong>-Weffc++</strong>
468 The biggest of these is the quadzillions of warnings about the
469 library headers emitted when <code>-Weffc++</code> is used. Making
470 libstdc++ &quot;-Weffc++-clean&quot; is not a goal of the project,
471 for a few reasons. Mainly, that option tries to enforce
472 object-oriented programming, while the Standard Library isn't
473 necessarily trying to be OO. There are multiple solutions
474 under discussion.
475 </p>
476 </a>
477 <a name="4_4_rel_ops">
478 <p><strong>rel_ops</strong>
479 Another is the <code>rel_ops</code> namespace and the template
480 comparison operator functions contained therein. If they become
481 visible in the same namespace as other comparison functions
482 (e.g., '<code>using</code>' them and the &lt;iterator&gt; header),
483 then you will suddenly be faced with huge numbers of ambiguity
484 errors. This was discussed on the -v3 list; Nathan Myers
485 <a href="http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html">sums
486 things up here</a>.
487 </p>
488 </a>
489 <a name="4_4_interface"><h3>The g++-3 headers are
490 <em>not ours</em></h3>
491 <p>If you have found an extremely broken header file which is
492 causing problems for you, look carefully before submitting a
493 &quot;high&quot; priority bug report (which you probably shouldn't
494 do anyhow; see the last paragraph of the page describing
495 <a href="http://gcc.gnu.org/gnatswrite.html">the GCC bug database</a>).
496 </p>
497 <p>If the headers are in <CODE>${prefix}/include/g++-3</CODE>, then
498 you are using the old libstdc++-v2 library, which is nonstandard
499 and unmaintained. Do not report problems with -v2 to the -v3
500 mailing list.
501 </p>
502 <p>Currently our header files are installed in
503 <CODE>${prefix}/include/g++-v3</CODE> (see the 'v'?). This may
504 change with the next release of GCC, as it may be too confusing,
505 but <a href="http://gcc.gnu.org/ml/gcc/2000-10/msg00732.html">the
506 question has not yet been decided</a>.
507 </p>
508 </a>
509 <a name="4_4_glibc">
510 <p><strong>glibc</strong>
511 If you're on a GNU/Linux system and have just upgraded to
512 glibc 2.2, but are still using gcc 2.95.2, then you should have
513 read the glibc FAQ, specifically 2.34:
514 <PRE>
515 2.34. When compiling C++ programs, I get a compilation error in streambuf.h.
517 {BH} You are using g++ 2.95.2? After upgrading to glibc 2.2, you need to
518 apply a patch to the include files in /usr/include/g++, because the fpos_t
519 type has changed in glibc 2.2. The patch is at
520 http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
521 </PRE>
522 Note that 2.95.x shipped with the
523 <a href="#4_4_interface">old v2 library</a> which is no longer
524 maintained. Also note that gcc 2.95.3 fixes this problem, but
525 requires a separate patch for libstdc++-v3.
526 </p>
527 </a>
528 <a name="4_4_checks">
529 <p><strong>concept checks</strong>
530 If you see compilation errors containing messages about
531 <code> <em>foo</em>Concept </code>and a<code> constraints </code>
532 member function, then most likely you have violated one of the
533 requirements for types used during instantiation of template
534 containers and functions. For example, EqualityComparableConcept
535 appears if your types must be comparable with == and you have not
536 provided this capability (a typo, or wrong visibility, or you
537 just plain forgot, etc).
538 </p>
539 <p>More information, including how to optionally enable/disable the
540 checks, is available
541 <a href="../19_diagnostics/howto.html#3">here</a>.
542 </p>
543 </a>
545 <hr>
546 <h2><a name="4_5">4.5 Aw, that's easy to fix!</a></h2>
547 <p>If you have found a bug in the library and you think you have
548 a working fix, then send it in! The main GCC site has a page
549 on <a href="http://gcc.gnu.org/contribute.html">submitting
550 patches</a> that covers the procedure, but for libstdc++ you
551 should also send the patch to our mailing list in addition to
552 the GCC patches mailing list. The libstdc++
553 <a href="../17_intro/contribute.html">contributors' page</a>
554 also talks about how to submit patches.
555 </p>
556 <p>In addition to the description, the patch, and the ChangeLog
557 entry, it is a Good Thing if you can additionally create a small
558 test program to test for the presence of the bug that your
559 patch fixes. Bugs have a way of being reintroduced; if an old
560 bug creeps back in, it will be caught immediately by the
561 <a href="#2_4">testsuite</a> -- but only if such a test exists.
562 </p>
564 <hr>
565 <h1><a name="5_0">5.0 Miscellaneous</a></h1>
566 <h2><a name="5_1">5.1 string::iterator is not char*;
567 vector&lt;T&gt;::iterator is not T*</a></h2>
568 <p>If you have code that depends on container&lt;T&gt; iterators
569 being implemented as pointer-to-T, your code is broken.
570 </p>
571 <p>While there are arguments for iterators to be implemented in
572 that manner, A) they aren't very good ones in the long term,
573 and B) they were never guaranteed by the Standard anyway. The
574 type-safety achieved by making iterators a real class rather
575 than a typedef for <code>T*</code> outweighs nearly all opposing
576 arguments.
577 </p>
578 <p>Code which does assume that a vector iterator <code> i </code>
579 is a pointer can often be fixed by changing <code> i </code> in
580 certain expressions to <code> &amp;*i </code>. Future revisions
581 of the Standard are expected to bless this usage for
582 vector&lt;&gt; (but not for basic_string&lt;&gt;).
583 </p>
585 <hr>
586 <h2><a name="5_2">5.2 What's next after libstdc++-v3?</a></h2>
587 <p>Hopefully, not much. The goal of libstdc++-v3 is to produce
588 a fully-compliant, fully-portable Standard Library. After that,
589 we're mostly done: there won't <em>be</em> any more compliance
590 work to do. However:
591 </p>
592 <ol>
593 <li><p>The ISO Committee will meet periodically to review Defect Reports
594 in the C++ Standard. Undoubtedly some of these will result in
595 changes to the Standard, which will be reflected in patches to
596 libstdc++. Some of that is already happening, see 4.2. Some of
597 those changes are being predicted by the library maintainers, and
598 we add code to the library based on what the current proposed
599 resolution specifies. Those additions are listed in
600 <a href="../ext/howto.html#5">the extensions page</a>.
601 </p>
602 <li><p>Performance tuning. Lots of performance tuning. This too is
603 already underway for post-3.0 releases, starting with memory
604 expansion in container classes and buffer usage in synchronized
605 stream objects.
606 </p>
607 <li><p>An ABI for libstdc++ will eventually be developed, so that
608 multiple binary-incompatible copies of the library can be replaced
609 with a single backwards-compatible library, like libgcc_s.so is.
610 </p>
611 <li><p>The current libstdc++ contains extensions to the Library which
612 must be explicitly requested by client code (for example, the
613 hash tables from SGI). Other extensions may be added to
614 libstdc++-v3 if they seem to be &quot;standard&quot; enough.
615 (For example, the &quot;long long&quot; type from C99.)
616 Bugfixes and rewrites (to improve or fix thread safety, for
617 instance) will of course be a continuing task.
618 </p>
619 </ol>
620 <p><A
621 HREF="http://gcc.gnu.org/ml/libstdc++/1999/msg00080.html">This
622 question</a> about the next libstdc++ prompted some brief but
623 interesting <A
624 HREF="http://gcc.gnu.org/ml/libstdc++/1999/msg00084.html">speculation</a>.
625 </p>
627 <hr>
628 <h2><a name="5_3">5.3 What about the STL from SGI?</a></h2>
629 <p>The <a href="http://www.sgi.com/Technology/STL/">STL from SGI</a>,
630 version 3.3, was the most recent merge of the STL codebase. The
631 code in libstdc++ contains many fixes and changes, and it is
632 very likely that the SGI code is no longer under active
633 development. We expect that no future merges will take place.
634 </p>
635 <p>In particular, <code>string</code> is not from SGI and makes no
636 use of their &quot;rope&quot; class (which is included as an
637 optional extension), nor is <code>valarray</code> and some others.
638 Classes like <code>vector&lt;&gt;</code> are, however.
639 </p>
640 <p>The FAQ for SGI's STL (one jump off of their main page) is
641 recommended reading.
642 </p>
644 <hr>
645 <h2><a name="5_4">5.4 Extensions and Backward Compatibility</a></h2>
646 <p>Although you can specify <code>-I</code> options to make the
647 preprocessor search the g++-v3/ext and /backward directories,
648 it is better to refer to files there by their path, as in:
649 <!-- Careful, the leading spaces in PRE show up directly. -->
650 </p>
651 <PRE>
652 #include &lt;ext/hash_map&gt;
653 </PRE>
654 <p>Extensions to the library have
655 <a href="../ext/howto.html">their own page</a>.
656 </p>
658 <hr>
659 <h2><a name="5_5">5.5 [removed]</a></h2>
660 <p>This question has become moot and has been removed. The stub
661 is here to preserve numbering (and hence links/bookmarks).
662 </p>
664 <hr>
665 <h2><a name="5_6">5.6 Is libstdc++-v3 thread-safe?</a></h2>
666 <p>Quick answer: no, as of 2.92 (eleventh snapshot), the
667 library is not appropriate for multithreaded access. The
668 string class is MT-safe.
669 </p>
670 <p>This is assuming that your idea of &quot;multithreaded&quot;
671 is the same as ours... The general question of multithreading
672 and libstdc++-v3 is addressed in the chapter-specific advice for
673 <a href="http://gcc.gnu.org/onlinedocs/libstdc++/17_intro/howto.html#3">Library
674 Introduction</a>. Threadsafe containers are covered in
675 more detail in
676 <a href="http://gcc.gnu.org/onlinedocs/libstdc++/23_containers/howto.html">the
677 Received Wisdom section on containers</a>.
678 <!-- I have successfully evaded the topic; my work here is
679 done- no, wait, I have to write those other sections... -->
680 </p>
682 <hr>
683 <h2><a name="5_7">5.7 How do I get a copy of the ISO C++ Standard?</a></h2>
684 <p>Copies of the full ISO 14882 standard are available on line via the
685 ISO mirror site for committee members. Non-members, or those who
686 have not paid for the privilege of sitting on the committee and
687 sustained their two-meeting commitment for voting rights, may get a
688 copy of the standard from their respective national standards
689 organization. In the USA, this national standards organization is
690 ANSI and their website is right <a href="http://www.ansi.org">here</a>.
691 (And if you've already registered with them, clicking this link will
692 take you to directly to the place where you can
693 <a href="http://webstore.ansi.org/ansidocstore/product.asp?sku=ISO%2FIEC+14882%2D1998">buy
694 the standard on-line</a>.
695 </p>
696 <p>Who is your country's member body? Visit the
697 <a href="http://www.iso.ch/">ISO homepage</a> and find out!
698 </p>
700 <!-- ####################################################### -->
702 <hr>
703 <P CLASS="fineprint"><em>
704 See <a href="../17_intro/license.html">license.html</a> for copying conditions.
705 Comments and suggestions are welcome, and may be sent to
706 <a href="mailto:libstdc++@gcc.gnu.org">the mailing list</a>.
707 </em></p>
710 </body>
711 </html>