I was doing a online coding contest and my idea was to find a header which has a shorter name than <iostream>
but includes <iostream>
. Well, I didnt suceed until now, but this made me wonder:
Does the standard specify what headers include other headers?
For example, on <iostream>
cplusplus states:
Including this header may automatically include other headers, such as
<ios>
,<streambuf>
,<istream>
,<ostream>
and/or<iosfwd>
.
However, when I look for <ios>
there is no such statement as "This header might be included by <iostream>
". For some headers I could imagine that they need to include others to work properly. And if this is the case, I would expect the standard to make some statement how the headers depend on each other (e.g. cyclic dependencies have to be avoided). Or does the standard just make sure that such dependencies do not exist and it is up to the implementation?
cplusplus
for good or peer-reviewed information. - PaulMcKenzie