Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!tcs!nujoizey!gwu From: gwu@nujoizey.tcs.com (George Wu) Newsgroups: comp.lang.c++ Subject: Re: precompiling header files (was: #pragma interface/implementation) Message-ID: <946@tcs.tcs.com> Date: 9 Aug 90 00:06:48 GMT References: <9008080109.AA03748@lem> Sender: usenet@tcs.com Reply-To: gwu@nujoizey.tcs.com (George Wu) Organization: Teknekron Communications Systems Lines: 23 In article <9008080109.AA03748@lem>, tmb@AI.MIT.EDU (Thomas M. Breuel) writes: |> ".g" files would also allow you to use a different programming |> style and free you from the need of duplicating many declarations. |> Currently, if you want a function to be compiled but do not want its |> source code included into every compilation unit that uses it, you must |> put a declaration into a header file, and repeat the declaration (as |> part of the definition) in the implementation part. This redundancy is |> a source of static errors and requires quite a bit of effort keeping |> two separate files (or parts of a file) consistent. After all, the |> source code already states clearly whether a particular object is local |> to the file (static), or local to a class (private/protected). What's wrong with including the header file in the implementation source as well? Then the compiler will see any inconsistency between the header and the implementation. George ---- George J Wu | gwu@tcs.com or ucbcad!tcs!gwu Software Engineer | 2121 Allston Way, Berkeley, CA, 94704 Teknekron Communications Systems, Inc.| (415) 649-3752