home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / info / libgpp.i01 < prev    next >
Encoding:
GNU Info File  |  1993-06-12  |  40.7 KB  |  819 lines

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