What does this piece of advice mean? It’s from The C++ Programming Language, Special Edition.
Declare standard library facilities by including its header, not by explicit declaration; §16.1.2.
Here’s an extract from §16.1.2 that I believe is relevant:
For a standard library
facility to be used its header must be
included. Writing out the relevant
declarations yourself is not a
standards-conforming alternative. The
reason is that some implementations
optimize compilation based on standard
header inclusion and others provide
optimized implementations of standard
library facilities triggered by the
headers. In general, implementers use
standard headers in ways programmers
cannot predict and shouldn’t have to
know about.
It means do this:
Not this:
You will often find people suggesting that doing the latter will lead to quicker compilation times (as the compiler won’t have to read and interpret all the standard header files).