Re: Warnings that won't go away
Re: Warnings that won't go away
- Subject: Re: Warnings that won't go away
- From: Uli Kusterer <email@hidden>
- Date: Fri, 2 Dec 2005 17:46:39 +0100
Am 30.11.2005 um 19:37 schrieb Alastair Houghton:
For instance, if your header depends on a system header, and won't
work without it included, it's best to #import/#include it in the
header file rather than requiring every source file that imports
your header to also include/import the other header.
Alistair is completely right here (no surprise there...), but one
thing I'd like to clarify is that this means *the header* wouldn't
work (i.e. wouldn't even compile) without the system header. OTOH, if
your class's header doesn't expose the system header's symbols, it
may actually make the compiler's job much easier to *only* include
that system header in your implementation file, and not in the header.
Again, this is meant to avoid dependencies and needlessly pulling
in dozens of headers into the files that use your header.
OTOH, if your class uses a special framework, including the header
for that framework in your class's header file may actually serve as
a reminder to also add the framework (then again, a comment could
work just as well).
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden