home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16740 < prev    next >
Encoding:
Text File  |  1992-11-22  |  1.3 KB  |  37 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
  3. From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
  4. Subject: Re: Idempotent header file proposal
  5. Message-ID: <9232813.11669@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <1992Nov19.090742.23696@cbfsb.cb.att.com>
  9. Date: Mon, 23 Nov 1992 02:18:24 GMT
  10. Lines: 25
  11.  
  12. nh@cbnewsg.cb.att.com (nicholas.hounsome) writes:
  13.  
  14. >One problem with C++ is that when used properly it requires huge
  15. >numbers of header files most of which are included multiple times.
  16. >Of course I know that there is the crude workaround :
  17. >
  18. >#ifndef HEADER_H
  19. >#define HEADER_H
  20. >
  21. >stuff
  22. >
  23. >#endif
  24. >
  25. >But the preprocessor still has to find, open , and read the whole file
  26. >so it does not realy gain you any efficiency.
  27.  
  28. No it doesn't. The GNU C Preprocessor checks each header file as it is read
  29. in to see whether it matches the above pattern. If so, it avoids reading
  30. the file on second time and subsequent times (unless you #undef HEADER_H).
  31.  
  32. -- 
  33. Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
  34. This .signature virus is a self-referential statement that is true - but 
  35. you will only be able to consistently believe it if you copy it to your own
  36. .signature file!
  37.