C ++ makes no guarantees whatsoever for any kind of recursive inclusion. You are responsible for including all the headings you need. Similarly, this does not guarantee that any particular standard library header will be omitted. (For example, your implementation can legally always include all the standard library headers!) That's why-and-because everything is in the std .
(I believe there is a special provision for C library headers - I think you wonβt get names in the global namespace unless you explicitly include these headers.)
Some headings have special requirements; for example, C ++ 11 (but not earlier) requires that <iostream> include both <ostream> and <istream> . But this is just one specific case.
source share