home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / IDIOMS.ZIP / 9-4.H < prev    next >
C/C++ Source or Header  |  1991-12-04  |  637b  |  25 lines

  1. /* Copyright (c) 1992 by AT&T Bell Laboratories. */
  2. /* Advanced C++ Programming Styles and Idioms */
  3. /* James O. Coplien */
  4. /* All rights reserved. */
  5.  
  6. /*
  7.  * Put general inlines down here.  This is to support a
  8.  * convention that inlines be broken out of the class
  9.  * declaration.  Also, putting the inlines after both the
  10.  * Envelope and Letter classes helps break some circular
  11.  * dependencies.
  12.  */
  13.  
  14. inline double
  15. Letter::postage() {
  16.     if (ounces < 2) return 29.0;
  17.     else return 29.0 + ((ounces - 1) * 23.0);
  18. }
  19.  
  20. inline Thing *
  21. Letter::type() {
  22.     extern Thing *letter;     // exemplar
  23.     return letter;
  24. }
  25.