Article View: comp.lang.c++.moderated
Article #72Re: Tool for removing surplus #includes
From: Andrew Dalgleish
Date: Wed, 06 Mar 1996 12:04
Date: Wed, 06 Mar 1996 12:04
36 lines
1946 bytes
1946 bytes
John A Hughes wrote:
[snip]
> A file should contain exactly the header files it depends on, no more and
> no less. If removing a #include causes you to add it somewhere else, you
> were relying on a non-local and confusing inclusion structure anyway, which
> you should be thrilled to have exposed. And why should one expect changing
> a header file not to "break" code that includes it anyway?
>
> I *hate* it when people give me libraries that insist I include something in
> order to include their file, or have to put includes in a certain order. It's
> stupid and unnecessary if you follow the simple rule above.
I agree. Here at Axon we also apply this concept to libraries.
Although a tool to ensure each #include is surrounded by the right
#if's should be easy. The biggest trouble would be tracking which definition
to use.
--
Andrew Dalgleish
Senior Software Engineer
Axon Research, Pty Ltd
6 Wallace Ave
Toorak, VIC
3142
AUSTRALIA
Tel: +61-3-9826-5538
Fax: +61-3-9824-0083
Email: andrewd@axonet.com.au
[ Articles to moderate: mailto:c++-submit@netlab.cs.rpi.edu ]
[ Read the C++ FAQ: http://www.connobj.com/cpp/cppfaq.htm ]
[ Moderation policy: http://www.connobj.com/cpp/guide.htm ]
[ Comments? mailto:c++-request@netlab.cs.rpi.edu ]
Technical Details
Message-ID:
<4hjv0f$72r@netlab.cs.rpi.edu>Path:
arc1-ca.pugleaf.net!library.erc.clarkson.edu!rpi!not-for-mailReferences:
<4gj0p3$lp0@solutions.solon.com> <4gum81$hlk@netlab.cs.rpi.edu> <4h2kto$c9k@netlab.cs.rpi.edu> <4hfccd$jun@netlab.cs.rpi.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!library.erc.clarkson.edu!rpi!not-for-mail From: Andrew Dalgleish <andrewd@axonet.com.au> Newsgroups: comp.lang.c++.moderated,comp.lang.c Subject: Re: Tool for removing surplus #includes Date: 6 Mar 1996 12:04:31 -0000 Organization: Axon Research, Pty Ltd Sender: cppmods@netlab.cs.rpi.edu Approved: devitto@ferndown.ate.slb.com Message-ID: <4hjv0f$72r@netlab.cs.rpi.edu> References: <4gj0p3$lp0@solutions.solon.com> <4gum81$hlk@netlab.cs.rpi.edu> <4h2kto$c9k@netlab.cs.rpi.edu> <4hfccd$jun@netlab.cs.rpi.edu> NNTP-Posting-Host: netlab.cs.rpi.edu X-Original-Date: Wed, 06 Mar 1996 19:37:34 +1000