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

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!microsoft!hexnut!jimad
  3. From: jimad@microsoft.com (Jim Adcock)
  4. Subject: Re: Idempotent header file proposal
  5. Message-ID: <1992Nov20.200435.18239@microsoft.com>
  6. Date: 20 Nov 92 20:04:35 GMT
  7. Organization: Microsoft Corporation
  8. References: <1992Nov19.090742.23696@cbfsb.cb.att.com>
  9. Lines: 28
  10.  
  11. In article <1992Nov19.090742.23696@cbfsb.cb.att.com> nh@cbnewsg.cb.att.com (nicholas.hounsome) writes:
  12. |One problem with C++ is that when used properly it requires huge
  13. |numbers of header files most of which are included multiple times.
  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. These statements are already contradicted by many C++ compilers that feature
  27. precompiled headers.  In such compilers the preprocessor *doesn't* have to
  28. find, open, nor read the header files.  Rather, the information in the header
  29. file simply preexists as if the header files had already been read.  
  30. In my experience using precompiled headers often can reduce my compile times 
  31. to a couple seconds when compiling on an old 386/20.  Frequently this 
  32. represents a 10X compilation speed up -- use precompiled headers if the
  33. option is at all available to you!  So what you describe is not a problem
  34. with "C++" -- rather it is a problem with some compilers not yet supporting
  35. precompiled headers.  Ultimately we will begin to see more and more C++
  36. development environments that not only offer precompiled headers, but
  37. incremental compile/link support as well.
  38.  
  39.