home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
- From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
- Subject: Re: Idempotent header file proposal
- Message-ID: <9232813.11669@mulga.cs.mu.OZ.AU>
- Sender: news@cs.mu.OZ.AU
- Organization: Computer Science, University of Melbourne, Australia
- References: <1992Nov19.090742.23696@cbfsb.cb.att.com>
- Date: Mon, 23 Nov 1992 02:18:24 GMT
- Lines: 25
-
- 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.
-
- No it doesn't. The GNU C Preprocessor checks each header file as it is read
- in to see whether it matches the above pattern. If so, it avoids reading
- the file on second time and subsequent times (unless you #undef HEADER_H).
-
- --
- Fergus Henderson fjh@munta.cs.mu.OZ.AU
- This .signature virus is a self-referential statement that is true - but
- you will only be able to consistently believe it if you copy it to your own
- .signature file!
-