home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!stanford.edu!lucid.com!lucid.com!jss
- From: jss@lucid.com (Jerry Schwarz)
- Subject: Re: Idempotent header file proposal
- Message-ID: <1992Nov19.221907.4801@lucid.com>
- Sender: usenet@lucid.com
- Reply-To: jss@lucid.com (Jerry Schwarz)
- Organization: Lucid, Inc.
- References: <1992Nov19.090742.23696@cbfsb.cb.att.com>
- Date: Thu, 19 Nov 92 22:19:07 GMT
- Lines: 23
-
- In article <1992Nov19.090742.23696@cbfsb.cb.att.com>, nh@cbnewsg.cb.att.com (nicholas.hounsome) writes:
- |> 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.
- |
-
- Some compilers/preprocessor recognize this construct in the header,
- remember it, and don't even reopen the file when HEADER_H is #defined at
- the point of the #include.
-
- I suggest you push your vendor to do this intelligent optimization
- rather than asking for a #pragma.
-
- -- Jerry Schwarz
-
-