By "self-sufficient", Xe means, local headers are not depending on System or External libraries.
That's not what I meant. They can depend on system of external libraries; but, if they do, they #include them themselves rather that rely on the file they're being included into.
then this works by "accident." Even though foo.h uses std::string and foo.h does not#include <string>, it works because <string> is included by bar.h before it includes foo.h. However, if you change the includes in bar.h, you could break foo.h. So it foo.h wants std::string, it needs to #include <string> itself.
That's not what I meant. They can depend on system of external libraries; but, if they do, they
#include
them themselves rather that rely on the file they're being included into.If I have this:
and:
then this works by "accident." Even though
foo.h
usesstd::string
andfoo.h
does not#include <string>
, it works because<string>
is included bybar.h
before it includesfoo.h
. However, if you change the includes inbar.h
, you could breakfoo.h
. So itfoo.h
wantsstd::string
, it needs to#include <string>
itself.That is exactly, What i meant, Probably not worded correct tho...
Thanks a lot tho,