Let's say I have a header file called foo.h
, and it includes another header, bar.h
.
I also have a header file called xyz.h
. It requires foo.h
and bar.h
, although foo.h
and bar.h
have nothing to do with each other, so I would feel weird to just include foo.h
(which still compiles since it includes bar.h
...
So, foo.h
includes bar.h
, bar.h
doesn't include foo.h
, but xyz.h
does include foo.h
and bar.h
. Is this bad practice? Is there any reason why I shouldn't? Why am I able to do this?