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

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!stanford.edu!lucid.com!lucid.com!jss
  3. From: jss@lucid.com (Jerry Schwarz)
  4. Subject: Re: Idempotent header file proposal
  5. Message-ID: <1992Nov19.221907.4801@lucid.com>
  6. Sender: usenet@lucid.com
  7. Reply-To: jss@lucid.com (Jerry Schwarz)
  8. Organization: Lucid, Inc.
  9. References:  <1992Nov19.090742.23696@cbfsb.cb.att.com>
  10. Date: Thu, 19 Nov 92 22:19:07 GMT
  11. Lines: 23
  12.  
  13. In article <1992Nov19.090742.23696@cbfsb.cb.att.com>, nh@cbnewsg.cb.att.com (nicholas.hounsome) writes:
  14. |> Of course I know that there is the crude workaround :
  15. |> 
  16. |> #ifndef HEADER_H
  17. |> #define HEADER_H
  18. |> 
  19. |> stuff
  20. |> 
  21. |> #endif
  22. |> 
  23. |> But the preprocessor still has to find, open , and read the whole file
  24. |> so it does not realy gain you any efficiency.
  25. |
  26.  
  27. Some compilers/preprocessor recognize this construct in the header,
  28. remember it, and don't even reopen the file when HEADER_H is #defined at
  29. the point of the #include. 
  30.  
  31. I suggest you push your vendor to do this intelligent optimization 
  32. rather than asking for a #pragma.
  33.  
  34.    -- Jerry Schwarz
  35.  
  36.