home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / info / libgpp.i01 (.txt) < prev    next >
GNU Info File  |  1993-06-12  |  42KB  |  663 lines

  1. This is Info file libgpp, produced by Makeinfo-1.47 from the input file
  2. libgpp.tex.
  3. START-INFO-DIR-ENTRY
  4. * Libg++: (libg++).        The g++ library.
  5. END-INFO-DIR-ENTRY
  6.    This file documents the features and implementation of The GNU C++
  7. library
  8.    Copyright (C) 1988, 1991, 1992 Free Software Foundation, Inc.
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided also
  14. that the section entitled "GNU Library General Public License" is
  15. included exactly as in the original, and provided that the entire
  16. resulting derived work is distributed under the terms of a permission
  17. notice identical to this one.
  18.    Permission is granted to copy and distribute translations of this
  19. manual into another language, under the above conditions for modified
  20. versions, except that the section entitled "GNU Library General Public
  21. License" and this permission notice may be included in translations
  22. approved by the Free Software Foundation instead of in the original
  23. English.
  24. File: libgpp,  Node: Top,  Next: Copying,  Up: (DIR)
  25.    Introduction ************
  26.    This manual documents how to install and use the GNU C++ library.
  27. * Menu:
  28. * Copying::        GNU Library Public License says how you can copy
  29.                     and share the GNU C++ library.
  30. * Contributors::    People who have contributed to GNU C++ library.
  31. * Installation::    How to configure, compile and install GNU C++ library
  32. * Trouble::         If you have trouble installing GNU C++ library.
  33. * General::         Aims, objectives, and limitations of the GNU C++ library
  34. * Conventions::     Stylistic conventions
  35. * OK::              Support for representation invariants
  36. * Proto::           Introduction to container class prototypes
  37. * Pix::             Pseudo-indexes
  38. * Representations:: How variable-sized objects are represented
  39. * Expressions::     Some guidance on programming expression-oriented classes
  40. * Headers::         Header files and other support for interfacing C++ to C
  41. * Builtin::         Utility functions for builtin types
  42. * New::             Library dynamic allocation primitives
  43. * IOStream::        input/output library (istreams and ostreams
  44. * Stream::          obsolete I/O library
  45. * Obstack::         Obstacks and their uses.
  46. * AllocRing::       A place to store objects for a while
  47. * String::          String, SubString, and Regex classes.
  48. * Integer::         Multiple precision Integer class.
  49. * Rational::        Multiple precision Rational class
  50. * Complex::         Complex number class
  51. * Fix::             Fixed point proportion classes
  52. * Bit::             BitSet and BitString classes
  53. * Random::          Random number generators
  54. * Data::            SampleStatistic and related classes for data collection
  55. * Curses::          CursesWindow class
  56. * List::            Lisp-like List prototype
  57. * LinkList::        Singly and doubly linked list class prototypes
  58. * Vector::          Vector prototypes
  59. * Plex::            Plex (adjustable array) prototypes
  60. * Stack::           Stack prototypes
  61. * Queue::           Queue prototypes
  62. * Deque::           Double ended queue prototypes
  63. * PQ::              Heap (priority queue) class prototypes
  64. * Set::             Set class prototypes
  65. * Bag::             Bag class prototypes
  66. * Map::             Map (Associative array) prototypes
  67. * GetOpt::          C++ class-based version of the GNU/UNIX getopt function
  68. * Projects::        Things Still Left to do
  69. File: libgpp,  Node: Copying,  Next: Contributors,  Prev: Top,  Up: Top
  70. GNU LIBRARY GENERAL PUBLIC LICENSE
  71. **********************************
  72.                          Version 2, June 1991
  73.      Copyright (C) 1991 Free Software Foundation, Inc.
  74.      675 Mass Ave, Cambridge, MA 02139, USA
  75.      Everyone is permitted to copy and distribute verbatim copies
  76.      of this license document, but changing it is not allowed.
  77.      
  78.      [This is the first released version of the library GPL.  It is
  79.       numbered 2 because it goes with version 2 of the ordinary GPL.]
  80. Preamble
  81. ========
  82.    The licenses for most software are designed to take away your
  83. freedom to share and change it.  By contrast, the GNU General Public
  84. Licenses are intended to guarantee your freedom to share and change
  85. free software--to make sure the software is free for all its users.
  86.    This license, the Library General Public License, applies to some
  87. specially designated Free Software Foundation software, and to any
  88. other libraries whose authors decide to use it.  You can use it for
  89. your libraries, too.
  90.    When we speak of free software, we are referring to freedom, not
  91. price.  Our General Public Licenses are designed to make sure that you
  92. have the freedom to distribute copies of free software (and charge for
  93. this service if you wish), that you receive source code or can get it
  94. if you want it, that you can change the software or use pieces of it in
  95. new free programs; and that you know you can do these things.
  96.    To protect your rights, we need to make restrictions that forbid
  97. anyone to deny you these rights or to ask you to surrender the rights.
  98. These restrictions translate to certain responsibilities for you if you
  99. distribute copies of the library, or if you modify it.
  100.    For example, if you distribute copies of the library, whether gratis
  101. or for a fee, you must give the recipients all the rights that we gave
  102. you.  You must make sure that they, too, receive or can get the source
  103. code.  If you link a program with the library, you must provide
  104. complete object files to the recipients so that they can relink them
  105. with the library, after making changes to the library and recompiling
  106. it.  And you must show them these terms so they know their rights.
  107.    Our method of protecting your rights has two steps: (1) copyright
  108. the library, and (2) offer you this license which gives you legal
  109. permission to copy, distribute and/or modify the library.
  110.    Also, for each distributor's protection, we want to make certain
  111. that everyone understands that there is no warranty for this free
  112. library.  If the library is modified by someone else and passed on, we
  113. want its recipients to know that what they have is not the original
  114. version, so that any problems introduced by others will not reflect on
  115. the original authors' reputations.
  116.    Finally, any free program is threatened constantly by software
  117. patents.  We wish to avoid the danger that companies distributing free
  118. software will individually obtain patent licenses, thus in effect
  119. transforming the program into proprietary software.  To prevent this,
  120. we have made it clear that any patent must be licensed for everyone's
  121. free use or not licensed at all.
  122.    Most GNU software, including some libraries, is covered by the
  123. ordinary GNU General Public License, which was designed for utility
  124. programs.  This license, the GNU Library General Public License,
  125. applies to certain designated libraries.  This license is quite
  126. different from the ordinary one; be sure to read it in full, and don't
  127. assume that anything in it is the same as in the ordinary license.
  128.    The reason we have a separate public license for some libraries is
  129. that they blur the distinction we usually make between modifying or
  130. adding to a program and simply using it.  Linking a program with a
  131. library, without changing the library, is in some sense simply using
  132. the library, and is analogous to running a utility program or
  133. application program.  However, in a textual and legal sense, the linked
  134. executable is a combined work, a derivative of the original library,
  135. and the ordinary General Public License treats it as such.
  136.    Because of this blurred distinction, using the ordinary General
  137. Public License for libraries did not effectively promote software
  138. sharing, because most developers did not use the libraries.  We
  139. concluded that weaker conditions might promote sharing better.
  140.    However, unrestricted linking of non-free programs would deprive the
  141. users of those programs of all benefit from the free status of the
  142. libraries themselves.  This Library General Public License is intended
  143. to permit developers of non-free programs to use free libraries, while
  144. preserving your freedom as a user of such programs to change the free
  145. libraries that are incorporated in them.  (We have not seen how to
  146. achieve this as regards changes in header files, but we have achieved
  147. it as regards changes in the actual functions of the Library.)  The
  148. hope is that this will lead to faster development of free libraries.
  149.    The precise terms and conditions for copying, distribution and
  150. modification follow.  Pay close attention to the difference between a
  151. "work based on the library" and a "work that uses the library".  The
  152. former contains code derived from the library, while the latter only
  153. works together with the library.
  154.    Note that it is possible for a library to be covered by the ordinary
  155. General Public License rather than by this special one.
  156.     TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  157.   1. This License Agreement applies to any software library which
  158.      contains a notice placed by the copyright holder or other
  159.      authorized party saying it may be distributed under the terms of
  160.      this Library General Public License (also called "this License"). 
  161.      Each licensee is addressed as "you".
  162.      A "library" means a collection of software functions and/or data
  163.      prepared so as to be conveniently linked with application programs
  164.      (which use some of those functions and data) to form executables.
  165.      The "Library", below, refers to any such software library or work
  166.      which has been distributed under these terms.  A "work based on the
  167.      Library" means either the Library or any derivative work under
  168.      copyright law: that is to say, a work containing the Library or a
  169.      portion of it, either verbatim or with modifications and/or
  170.      translated straightforwardly into another language.  (Hereinafter,
  171.      translation is included without limitation in the term
  172.      "modification".)
  173.      "Source code" for a work means the preferred form of the work for
  174.      making modifications to it.  For a library, complete source code
  175.      means all the source code for all modules it contains, plus any
  176.      associated interface definition files, plus the scripts used to
  177.      control compilation and installation of the library.
  178.      Activities other than copying, distribution and modification are
  179.      not covered by this License; they are outside its scope.  The act
  180.      of running a program using the Library is not restricted, and
  181.      output from such a program is covered only if its contents
  182.      constitute a work based on the Library (independent of the use of
  183.      the Library in a tool for writing it).  Whether that is true
  184.      depends on what the Library does and what the program that uses
  185.      the Library does.
  186.   2. You may copy and distribute verbatim copies of the Library's
  187.      complete source code as you receive it, in any medium, provided
  188.      that you conspicuously and appropriately publish on each copy an
  189.      appropriate copyright notice and disclaimer of warranty; keep
  190.      intact all the notices that refer to this License and to the
  191.      absence of any warranty; and distribute a copy of this License
  192.      along with the Library.
  193.      You may charge a fee for the physical act of transferring a copy,
  194.      and you may at your option offer warranty protection in exchange
  195.      for a fee.
  196.   3. You may modify your copy or copies of the Library or any portion
  197.      of it, thus forming a work based on the Library, and copy and
  198.      distribute such modifications or work under the terms of Section 1
  199.      above, provided that you also meet all of these conditions:
  200.        1. The modified work must itself be a software library.
  201.        2. You must cause the files modified to carry prominent notices
  202.           stating that you changed the files and the date of any change.
  203.        3. You must cause the whole of the work to be licensed at no
  204.           charge to all third parties under the terms of this License.
  205.        4. If a facility in the modified Library refers to a function or
  206.           a table of data to be supplied by an application program that
  207.           uses the facility, other than as an argument passed when the
  208.           facility is invoked, then you must make a good faith effort
  209.           to ensure that, in the event an application does not supply
  210.           such function or table, the facility still operates, and
  211.           performs whatever part of its purpose remains meaningful.
  212.           (For example, a function in a library to compute square roots
  213.           has a purpose that is entirely well-defined independent of the
  214.           application.  Therefore, Subsection 2d requires that any
  215.           application-supplied function or table used by this function
  216.           must be optional: if the application does not supply it, the
  217.           square root function must still compute square roots.)
  218.      These requirements apply to the modified work as a whole.  If
  219.      identifiable sections of that work are not derived from the
  220.      Library, and can be reasonably considered independent and separate
  221.      works in themselves, then this License, and its terms, do not
  222.      apply to those sections when you distribute them as separate
  223.      works.  But when you distribute the same sections as part of a
  224.      whole which is a work based on the Library, the distribution of
  225.      the whole must be on the terms of this License, whose permissions
  226.      for other licensees extend to the entire whole, and thus to each
  227.      and every part regardless of who wrote it.
  228.      Thus, it is not the intent of this section to claim rights or
  229.      contest your rights to work written entirely by you; rather, the
  230.      intent is to exercise the right to control the distribution of
  231.      derivative or collective works based on the Library.
  232.      In addition, mere aggregation of another work not based on the
  233.      Library with the Library (or with a work based on the Library) on
  234.      a volume of a storage or distribution medium does not bring the
  235.      other work under the scope of this License.
  236.   4. You may opt to apply the terms of the ordinary GNU General Public
  237.      License instead of this License to a given copy of the Library. 
  238.      To do this, you must alter all the notices that refer to this
  239.      License, so that they refer to the ordinary GNU General Public
  240.      License, version 2, instead of to this License.  (If a newer
  241.      version than version 2 of the ordinary GNU General Public License
  242.      has appeared, then you can specify that version instead if you
  243.      wish.)  Do not make any other change in these notices.
  244.      Once this change is made in a given copy, it is irreversible for
  245.      that copy, so the ordinary GNU General Public License applies to
  246.      all subsequent copies and derivative works made from that copy.
  247.      This option is useful when you wish to copy part of the code of
  248.      the Library into a program that is not a library.
  249.   5. You may copy and distribute the Library (or a portion or
  250.      derivative of it, under Section 2) in object code or executable
  251.      form under the terms of Sections 1 and 2 above provided that you
  252.      accompany it with the complete corresponding machine-readable
  253.      source code, which must be distributed under the terms of Sections
  254.      1 and 2 above on a medium customarily used for software
  255.      interchange.
  256.      If distribution of object code is made by offering access to copy
  257.      from a designated place, then offering equivalent access to copy
  258.      the source code from the same place satisfies the requirement to
  259.      distribute the source code, even though third parties are not
  260.      compelled to copy the source along with the object code.
  261.   6. A program that contains no derivative of any portion of the
  262.      Library, but is designed to work with the Library by being
  263.      compiled or linked with it, is called a "work that uses the
  264.      Library".  Such a work, in isolation, is not a derivative work of
  265.      the Library, and therefore falls outside the scope of this License.
  266.      However, linking a "work that uses the Library" with the Library
  267.      creates an executable that is a derivative of the Library (because
  268.      it contains portions of the Library), rather than a "work that
  269.      uses the library".  The executable is therefore covered by this
  270.      License. Section 6 states terms for distribution of such
  271.      executables.
  272.      When a "work that uses the Library" uses material from a header
  273.      file that is part of the Library, the object code for the work may
  274.      be a derivative work of the Library even though the source code is
  275.      not. Whether this is true is especially significant if the work
  276.      can be linked without the Library, or if the work is itself a
  277.      library.  The threshold for this to be true is not precisely
  278.      defined by law.
  279.      If such an object file uses only numerical parameters, data
  280.      structure layouts and accessors, and small macros and small inline
  281.      functions (ten lines or less in length), then the use of the object
  282.      file is unrestricted, regardless of whether it is legally a
  283.      derivative work.  (Executables containing this object code plus
  284.      portions of the Library will still fall under Section 6.)
  285.      Otherwise, if the work is a derivative of the Library, you may
  286.      distribute the object code for the work under the terms of Section
  287.      6. Any executables containing that work also fall under Section 6,
  288.      whether or not they are linked directly with the Library itself.
  289.   7. As an exception to the Sections above, you may also compile or
  290.      link a "work that uses the Library" with the Library to produce a
  291.      work containing portions of the Library, and distribute that work
  292.      under terms of your choice, provided that the terms permit
  293.      modification of the work for the customer's own use and reverse
  294.      engineering for debugging such modifications.
  295.      You must give prominent notice with each copy of the work that the
  296.      Library is used in it and that the Library and its use are covered
  297.      by this License.  You must supply a copy of this License.  If the
  298.      work during execution displays copyright notices, you must include
  299.      the copyright notice for the Library among them, as well as a
  300.      reference directing the user to the copy of this License.  Also,
  301.      you must do one of these things:
  302.        1. Accompany the work with the complete corresponding
  303.           machine-readable source code for the Library including
  304.           whatever changes were used in the work (which must be
  305.           distributed under Sections 1 and 2 above); and, if the work
  306.           is an executable linked with the Library, with the complete
  307.           machine-readable "work that uses the Library", as object code
  308.           and/or source code, so that the user can modify the Library
  309.           and then relink to produce a modified executable containing
  310.           the modified Library.  (It is understood that the user who
  311.           changes the contents of definitions files in the Library will
  312.           not necessarily be able to recompile the application to use
  313.           the modified definitions.)
  314.        2. Accompany the work with a written offer, valid for at least
  315.           three years, to give the same user the materials specified in
  316.           Subsection 6a, above, for a charge no more than the cost of
  317.           performing this distribution.
  318.        3. If distribution of the work is made by offering access to copy
  319.           from a designated place, offer equivalent access to copy the
  320.           above specified materials from the same place.
  321.        4. Verify that the user has already received a copy of these
  322.           materials or that you have already sent this user a copy.
  323.      For an executable, the required form of the "work that uses the
  324.      Library" must include any data and utility programs needed for
  325.      reproducing the executable from it.  However, as a special
  326.      exception, the source code distributed need not include anything
  327.      that is normally distributed (in either source or binary form)
  328.      with the major components (compiler, kernel, and so on) of the
  329.      operating system on which the executable runs, unless that
  330.      component itself accompanies the executable.
  331.      It may happen that this requirement contradicts the license
  332.      restrictions of other proprietary libraries that do not normally
  333.      accompany the operating system.  Such a contradiction means you
  334.      cannot use both them and the Library together in an executable
  335.      that you distribute.
  336.   8. You may place library facilities that are a work based on the
  337.      Library side-by-side in a single library together with other
  338.      library facilities not covered by this License, and distribute
  339.      such a combined library, provided that the separate distribution
  340.      of the work based on the Library and of the other library
  341.      facilities is otherwise permitted, and provided that you do these
  342.      two things:
  343.        1. Accompany the combined library with a copy of the same work
  344.           based on the Library, uncombined with any other library
  345.           facilities.  This must be distributed under the terms of the
  346.           Sections above.
  347.        2. Give prominent notice with the combined library of the fact
  348.           that part of it is a work based on the Library, and explaining
  349.           where to find the accompanying uncombined form of the same
  350.           work.
  351.   9. You may not copy, modify, sublicense, link with, or distribute the
  352.      Library except as expressly provided under this License.  Any
  353.      attempt otherwise to copy, modify, sublicense, link with, or
  354.      distribute the Library is void, and will automatically terminate
  355.      your rights under this License.  However, parties who have
  356.      received copies, or rights, from you under this License will not
  357.      have their licenses terminated so long as such parties remain in
  358.      full compliance.
  359.  10. You are not required to accept this License, since you have not
  360.      signed it.  However, nothing else grants you permission to modify
  361.      or distribute the Library or its derivative works.  These actions
  362.      are prohibited by law if you do not accept this License. 
  363.      Therefore, by modifying or distributing the Library (or any work
  364.      based on the Library), you indicate your acceptance of this
  365.      License to do so, and all its terms and conditions for copying,
  366.      distributing or modifying the Library or works based on it.
  367.  11. Each time you redistribute the Library (or any work based on the
  368.      Library), the recipient automatically receives a license from the
  369.      original licensor to copy, distribute, link with or modify the
  370.      Library subject to these terms and conditions.  You may not impose
  371.      any further restrictions on the recipients' exercise of the rights
  372.      granted herein. You are not responsible for enforcing compliance
  373.      by third parties to this License.
  374.  12. If, as a consequence of a court judgment or allegation of patent
  375.      infringement or for any other reason (not limited to patent
  376.      issues), conditions are imposed on you (whether by court order,
  377.      agreement or otherwise) that contradict the conditions of this
  378.      License, they do not excuse you from the conditions of this
  379.      License.  If you cannot distribute so as to satisfy simultaneously
  380.      your obligations under this License and any other pertinent
  381.      obligations, then as a consequence you may not distribute the
  382.      Library at all.  For example, if a patent license would not permit
  383.      royalty-free redistribution of the Library by all those who
  384.      receive copies directly or indirectly through you, then the only
  385.      way you could satisfy both it and this License would be to refrain
  386.      entirely from distribution of the Library.
  387.      If any portion of this section is held invalid or unenforceable
  388.      under any particular circumstance, the balance of the section is
  389.      intended to apply, and the section as a whole is intended to apply
  390.      in other circumstances.
  391.      It is not the purpose of this section to induce you to infringe any
  392.      patents or other property right claims or to contest validity of
  393.      any such claims; this section has the sole purpose of protecting
  394.      the integrity of the free software distribution system which is
  395.      implemented by public license practices.  Many people have made
  396.      generous contributions to the wide range of software distributed
  397.      through that system in reliance on consistent application of that
  398.      system; it is up to the author/donor to decide if he or she is
  399.      willing to distribute software through any other system and a
  400.      licensee cannot impose that choice.
  401.      This section is intended to make thoroughly clear what is believed
  402.      to be a consequence of the rest of this License.
  403.  13. If the distribution and/or use of the Library is restricted in
  404.      certain countries either by patents or by copyrighted interfaces,
  405.      the original copyright holder who places the Library under this
  406.      License may add an explicit geographical distribution limitation
  407.      excluding those countries, so that distribution is permitted only
  408.      in or among countries not thus excluded.  In such case, this
  409.      License incorporates the limitation as if written in the body of
  410.      this License.
  411.  14. The Free Software Foundation may publish revised and/or new
  412.      versions of the Library General Public License from time to time.
  413.      Such new versions will be similar in spirit to the present version,
  414.      but may differ in detail to address new problems or concerns.
  415.      Each version is given a distinguishing version number.  If the
  416.      Library specifies a version number of this License which applies
  417.      to it and "any later version", you have the option of following
  418.      the terms and conditions either of that version or of any later
  419.      version published by the Free Software Foundation.  If the Library
  420.      does not specify a license version number, you may choose any
  421.      version ever published by the Free Software Foundation.
  422.  15. If you wish to incorporate parts of the Library into other free
  423.      programs whose distribution conditions are incompatible with these,
  424.      write to the author to ask for permission.  For software which is
  425.      copyrighted by the Free Software Foundation, write to the Free
  426.      Software Foundation; we sometimes make exceptions for this.  Our
  427.      decision will be guided by the two goals of preserving the free
  428.      status of all derivatives of our free software and of promoting
  429.      the sharing and reuse of software generally.
  430.                                 NO WARRANTY
  431.  16. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
  432.      WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE
  433.      LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS
  434.      AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY
  435.      OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
  436.      LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  437.      FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND
  438.      PERFORMANCE OF THE LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE
  439.      DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR
  440.      OR CORRECTION.
  441.  17. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  442.      WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
  443.      MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE
  444.      LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
  445.      INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
  446.      INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF
  447.      DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
  448.      OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY
  449.      OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
  450.      ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  451.                       END OF TERMS AND CONDITIONS
  452. How to Apply These Terms to Your New Libraries
  453. ==============================================
  454.    If you develop a new library, and you want it to be of the greatest
  455. possible use to the public, we recommend making it free software that
  456. everyone can redistribute and change.  You can do so by permitting
  457. redistribution under these terms (or, alternatively, under the terms of
  458. the ordinary General Public License).
  459.    To apply these terms, attach the following notices to the library. 
  460. It is safest to attach them to the start of each source file to most
  461. effectively convey the exclusion of warranty; and each file should have
  462. at least the "copyright" line and a pointer to where the full notice is
  463. found.
  464.      ONE LINE TO GIVE THE LIBRARY'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
  465.      Copyright (C) YEAR  NAME OF AUTHOR
  466.      
  467.      This library is free software; you can redistribute it and/or
  468.      modify it under the terms of the GNU Library General Public
  469.      License as published by the Free Software Foundation; either
  470.      version 2 of the License, or (at your option) any later version.
  471.      
  472.      This library is distributed in the hope that it will be useful,
  473.      but WITHOUT ANY WARRANTY; without even the implied warranty of
  474.      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  475.      Library General Public License for more details.
  476.      
  477.      You should have received a copy of the GNU Library General Public
  478.      License along with this library; if not, write to the Free
  479.      Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  480.    Also add information on how to contact you by electronic and paper
  481. mail.
  482.    You should also get your employer (if you work as a programmer) or
  483. your school, if any, to sign a "copyright disclaimer" for the library,
  484. if necessary.  Here is a sample; alter the names:
  485.      Yoyodyne, Inc., hereby disclaims all copyright interest in the
  486.      library `Frob' (a library for tweaking knobs) written by James Random Hacker.
  487.      
  488.      SIGNATURE OF TY COON, 1 April 1990
  489.      Ty Coon, President of Vice
  490.    That's all there is to it!
  491. File: libgpp,  Node: Contributors,  Next: Installation,  Prev: Copying,  Up: Top
  492. Contributors to GNU C++ library
  493. *******************************
  494.    Aside from Michael Tiemann, who worked out the front end for GNU
  495. C++, and Richard Stallman, who worked out the back end, the following
  496. people (not including those who have made their contributions to GNU
  497. CC) should not go unmentioned.
  498.    * Doug Lea contributed most otherwise unattributed classes.
  499.    * Per Bothner contributed the iostream I/O classes.
  500.    * Dirk Grunwald contributed the Random number generation classes,
  501.      and PairingHeaps.
  502.    * Kurt Baudendistel contributed Fixed precision reals.
  503.    * Doug Schmidt contributed ordered hash tables, a perfect hash
  504.      function generator, and several other utilities.
  505.    * Marc Shapiro contributed the ideas and preliminary code for Plexes.
  506.    * Eric Newton contributed the curses window classes.
  507.    * Some of the I/O code is derived from BSD 4.4, and was developed by
  508.      the University of California, Berkeley.
  509.    * The code for converting accurately between floating point numbers
  510.      and their string representations was written by David M. Gay of
  511.      AT&T.
  512. File: libgpp,  Node: Installation,  Next: Trouble,  Prev: Contributors,  Up: Top
  513. Installing GNU C++ library
  514. **************************
  515.   1. Read through the README file and the Makefile. Make sure that all
  516.      paths, system-dependent compile switches, and program names are
  517.      correct.
  518.   2. Check that files  `values.h', `stdio.h', and `math.h' declare and
  519.      define values appropriate for your system.
  520.   3. Type `make all' to compile the library, test, and install. Current
  521.      details about contents of the tests and utilities are in the
  522.      `README' file.
  523. File: libgpp,  Node: Trouble,  Next: General,  Prev: Installation,  Up: Top
  524. Trouble in Installation
  525. ***********************
  526.    Here are some of the things that have caused trouble for people
  527. installing GNU C++ library.
  528.   1. Make sure that your GNU C++ version number is at least as high as
  529.      your libg++ version number. For example, libg++ 1.22.0 requires
  530.      g++ 1.22.0 or later releases.
  531.   2. Double-check system constants in the header files mentioned above.
  532. File: libgpp,  Node: General,  Next: Conventions,  Prev: Trouble,  Up: Top
  533. GNU C++ library aims, objectives, and limitations
  534. *************************************************
  535.    The GNU C++ library, libg++ is an attempt to provide a variety of C++
  536. programming tools and other support to GNU C++ programmers.
  537.    Differences in distribution policy are only part of the difference
  538. between libg++.a and AT&T libC.a.  libg++ is not intended to be an
  539. exact clone of libC. For one, libg++ contains bits of code that depend
  540. on special features of GNU g++ that are either different or lacking in
  541. the AT&T version, including slightly different inlining and overloading
  542. strategies, dynamic local arrays, wrappers, etc.  All of these
  543. differences are minor. For example, while the AT&T and GNU stream
  544. classes are implemented in very different ways, the vast majority of
  545. C++ programs compile and run under either version with no visible
  546. difference. Additionally, all g++-specific constructs are conditionally
  547. compiled; The library is designed to be compatible with any 2.0 C++
  548. compiler.
  549.    libg++ has also contained workarounds for some limitations in g++:
  550. both g++ and libg++ are still undergoing rapid development and
  551. testing--a task that is helped tremendously by the feedback of active
  552. users.  This manual is also still under development; it has some
  553. catching up to do to include all the facilities now in the library.
  554.    libg++ is not the only freely available source of C++ class
  555. libraries. The most notable alternative sources are Interviews and
  556. OOPS. (A g++-compatible version of OOPS is currently available on
  557. prep.ai.mit.edu. InterViews has been available on the X-windows X11
  558. tapes and also from interviews.stanford.edu.)
  559.    As every C++ programmer knows, the design (moreso than the
  560. implementation) of a C++ class library is something of a challenge.
  561. Part of the reason is that C++ supports two, partially incompatible,
  562. styles of object-oriented programming -- The "forest" approach,
  563. involving a collection of free-standing classes that can be mixed and
  564. matched, versus the completely hierarchical (smalltalk style) approach,
  565. in which all classes are derived from a common ancestor.  Of course,
  566. both styles have advantages and disadvantages.  So far, libg++ has
  567. adopted the "forest" approach.  Keith Gorlen's OOPS library adopts the
  568. hierarchical approach, and may be an attractive alternative for C++
  569. programmers who prefer this style.
  570.    Currently (and/or in the near future) libg++ provides support for a
  571. few basic kinds of classes:
  572.    The first kind of support provides an interface between C++ programs
  573. and C libraries. This includes basic header files (like `stdio.h') as
  574. well as things like the File and stream classes. Other classes that
  575. interface to other aspects of C libraries (like those that maintain
  576. environmental information) are in various stages of development; all
  577. will undergo implementation modifications when the forthcoming GNU libc
  578. library is released.
  579.    The second kind of support contains general-purpose basic classes
  580. that transparently manage variable-sized objects on the freestore.  This
  581. includes Obstacks, multiple-precision Integers and Rationals, arbitrary
  582. length Strings, BitSets, and BitStrings.
  583.    Third, several classes and utilities of common interest (e.g.,
  584. Complex numbers) are provided.
  585.    Fourth, a set of pseudo-generic prototype files are available as a
  586. mechanism for generating common container classes. These are described
  587. in more detail in the introduction to container prototypes. Currently,
  588. only a the textual substitution mechanism is available for generic
  589. class creation.
  590. File: libgpp,  Node: Conventions,  Next: OK,  Prev: General,  Up: Top
  591. GNU C++ library stylistic conventions
  592. *************************************
  593.    * C++ source files have file extension `.cc'. Both C-compatibility
  594.      header files and class declaration files have extension `.h'.
  595.    * C++ class names begin with capital letters, except for `istream'
  596.      and `ostream', for AT&T C++ compatibility. Multi-word class names
  597.      capitalize each word, with no underscore separation.
  598.    * Include files that define C++ classes begin with capital letters
  599.      (as do the names of the classes themselves).  `stream.h' is
  600.      uncapitalized for AT&T C++ compatibility.
  601.    * Include files that supply function prototypes for other C
  602.      functions (system calls and libraries) are all lower case.
  603.    * All include files define a preprocessor variable _X_h, where X is
  604.      the name of the file, and conditionally compile only if this has
  605.      not been already defined. The `#pragma once' facility is also used
  606.      to avoid re-inclusion.
  607.    * Structures and objects that must be publicly defined, but are not
  608.      intended for public use have names beginning with an underscore.
  609.      (for example, the `_Srep' struct, which is used only by the String
  610.      and SubString classes.)
  611.    * The underscore is used to separate components of long function
  612.      names,
  613.      e.g., `set_File_exception_handler()'.
  614.    * When a function could be usefully defined either as a member or a
  615.      friend, it is generally a member if it modifies and/or returns
  616.      itself, else it is a friend. There are cases where naturalness of
  617.      expression wins out over this rule.
  618.    * Class declaration files are formatted so that it is easy to
  619.      quickly check them to determine function names, parameters, and so
  620.      on. Because of the different kinds of things that may appear in
  621.      class declarations, there is no perfect way to do this. Any
  622.      suggestions on developing a common class declaration formatting
  623.      style are welcome.
  624.    * All classes use the same simple error (exception) handling
  625.      strategy. Almost every class has a member function named
  626.      `error(char* msg)' that invokes an associated error handler
  627.      function via a pointer to that function, so that the error
  628.      handling function may be reset by programmers. By default nearly
  629.      all call `*lib_error_handler', which prints the message and then
  630.      aborts execution. This system is subject to change. In general,
  631.      errors are assumed to be non-recoverable: Library classes do not
  632.      include code that allows graceful continuation after exceptions.
  633. File: libgpp,  Node: OK,  Next: Proto,  Prev: Conventions,  Up: Top
  634. Support for representation invariants
  635. *************************************
  636.    Most GNU C++ library classes possess a method named `OK()', that is
  637. useful in helping to verify correct performance of class operations.
  638.    The `OK()' operations checks the "representation invariant" of a
  639. class object. This is a test to check whether the object is in a valid
  640. state. In effect, it is a (sometimes partial) verification of the
  641. library's promise that (1) class operations always leave objects in
  642. valid states, and (2) the class protects itself so that client functions
  643. cannot corrupt this state.
  644.    While no simple validation technique can assure that all operations
  645. perform correctly, calls to `OK()' can at least verify that operations
  646. do not corrupt representations. For example for `String a, b, c; ... a
  647. = b + c;', a call to `a.OK();' will guarantee that `a' is a valid
  648. `String', but does not guarantee that it contains the concatenation of
  649. `b + c'. However, given that `a' is known to be valid, it is possible
  650. to further verify its properties, for example via `a.after(b) == c &&
  651. a.before(c) == b'. In other words, `OK()' generally checks only those
  652. internal representation properties that are otherwise inaccessible to
  653. users of the class. Other class operations are often useful for further
  654. validation.
  655.    Failed calls to `OK()' call a class's `error' method if one exists,
  656. else the directly call `abort'. Failure indicates an implementation
  657. error that should be reported.
  658.    With only rare exceptions, the internal support functions for a class
  659. never themselves call `OK()' (although many of the test files in the
  660. distribution call `OK()' extensively).
  661.    Verification of representational invariants can sometimes be very
  662. time consuming for complicated data structures.
  663.