M
Marco Spatz
Hi,
I used PCLint to check my code yesterday and got some warnings about
"Repeated include files" and "Redundant declaration for symbol
'CLASSNAME'". I know the reasons for these warnings and I think they are
not a problem. But all this made me think about the order in which
header files are include.
Think about a 4 layered architecture with
layer GUI (contains GUI_A,h, ...)
layer APP (contains APP_A.h, ...)
layer CORE (contains CORE_A.h, CORE_B.h, CORE_C.h ... you get it)
layer STL (contains vector, set, ...)
and a top-bottom dependency.
Now let's say class GUI_A needs APP_A.h, CORE_A.h, and vector to be
included in it's header. What would be the correct order to include it?
Starting at the bottom or at the top?
And further, class GUI_A needs GUI_A.h, APP_B.h, CORE_B.h and set in
it's source to compile. Should this be in the same order as in the
header file?
Does the standard say something about it? Or are the any guidelines for
this?
Thanks in advance,
Marco
I used PCLint to check my code yesterday and got some warnings about
"Repeated include files" and "Redundant declaration for symbol
'CLASSNAME'". I know the reasons for these warnings and I think they are
not a problem. But all this made me think about the order in which
header files are include.
Think about a 4 layered architecture with
layer GUI (contains GUI_A,h, ...)
layer APP (contains APP_A.h, ...)
layer CORE (contains CORE_A.h, CORE_B.h, CORE_C.h ... you get it)
layer STL (contains vector, set, ...)
and a top-bottom dependency.
Now let's say class GUI_A needs APP_A.h, CORE_A.h, and vector to be
included in it's header. What would be the correct order to include it?
Starting at the bottom or at the top?
And further, class GUI_A needs GUI_A.h, APP_B.h, CORE_B.h and set in
it's source to compile. Should this be in the same order as in the
header file?
Does the standard say something about it? Or are the any guidelines for
this?
Thanks in advance,
Marco