home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / gnu / libg++-2.5.3-bin.lha / info / libg++.info-1 < prev    next >
Encoding:
GNU Info File  |  1994-02-27  |  40.1 KB  |  823 lines

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