In article <e8**********************************@t1g2000pra.g ooglegroups.com>,
Florian Kaufmann <se*******@gmail.comwrote:
>Hello
Is there a tool that helps to keep the list of include directives
clean and tidy? I would like that each header/source file has only the
includes that it really needs, and that forward declarations are used
instead of includes where possible.
[OT]
The latter part of that is not recommended. If you have the same
function declaration in multiple files, then when you change
the declaration, you will have to go around to each file that
textually declares it and modify the code. That process is error
prone; it is pretty much inevitable that the declarations *will*
get out of sync. If, however, you #include the declaration of
the header, then you only need to modify one place, the #include
file, after which the compiler will be able to catch any
now-incompatible calls to the function.
--
"History is a pile of debris" -- Laurie Anderson