home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!microsoft!hexnut!jimad
- From: jimad@microsoft.com (Jim Adcock)
- Subject: Re: Idempotent header file proposal
- Message-ID: <1992Nov20.200435.18239@microsoft.com>
- Date: 20 Nov 92 20:04:35 GMT
- Organization: Microsoft Corporation
- References: <1992Nov19.090742.23696@cbfsb.cb.att.com>
- Lines: 28
-
- In article <1992Nov19.090742.23696@cbfsb.cb.att.com> nh@cbnewsg.cb.att.com (nicholas.hounsome) writes:
- |One problem with C++ is that when used properly it requires huge
- |numbers of header files most of which are included multiple times.
- |Of course I know that there is the crude workaround :
- |
- |#ifndef HEADER_H
- |#define HEADER_H
- |
- |stuff
- |
- |#endif
- |
- |But the preprocessor still has to find, open , and read the whole file
- |so it does not realy gain you any efficiency.
-
- These statements are already contradicted by many C++ compilers that feature
- precompiled headers. In such compilers the preprocessor *doesn't* have to
- find, open, nor read the header files. Rather, the information in the header
- file simply preexists as if the header files had already been read.
- In my experience using precompiled headers often can reduce my compile times
- to a couple seconds when compiling on an old 386/20. Frequently this
- represents a 10X compilation speed up -- use precompiled headers if the
- option is at all available to you! So what you describe is not a problem
- with "C++" -- rather it is a problem with some compilers not yet supporting
- precompiled headers. Ultimately we will begin to see more and more C++
- development environments that not only offer precompiled headers, but
- incremental compile/link support as well.
-
-