It's not a predefined file actually and name doesn't have meaning except it was made intentionally distinctive. It could be decoded as "standard C++" which is as misguided as it may get. Name itself appearance is contemporary to appearance of Morozov's STL library, so it may related to namespace std
. I can call a file <Those_Are_Very_Imprtant_Declarations.h> or <a123126>
, that's just the same.
Historically that file was included into examples of some C++ guides , essentially replacing all required includes and declarations with one-liner. Usually there was description of that file somewhere or how to replace that line, some books included floppy or CD. The content of file is not agreed upon, but usually it included all headers used in examples. Sometimes it contains using namespace std;
line. In some cases there are some type definitions, that was typical for versions that predate C++98\03, e.g. before stdint.h
\ cstdint
was present.
The thing is, the C++ language appeared in 1987 with first implementations available as early as 1988, but standard appeared only in 1998. Before that every compiler had some quirks, implemented one or or another feature differently, had alternative names for headers. STL appeared in 90s and was an "external" library. C++primers usually were mentioning which proprietary
compiler they are compatible with or offered list of compatible versions. The header would make it easier by creating "standard" environment for every implementation in which all book's examples and exercises will work.
That's history of the name.
Afaik GNU environment may include that because it was used in tests and for creation of precompiled headers. E.g., this is content of file for libstdc++
run-time included with GCC 4.8. You can see #ifdef
that separates C++11 headers from C++98. Leter there appears more.
But not every platform with C++ compiler, not every GCC flavor may have access to this file as a part of libstdc++
run-time library, to which this name is linked today. Presence of using namespace std;
in some non-GNU versions makes them dangerous and content of file changes from version to version.
Greatest disadvantage of using that file is portability. There is also concern of using it without precompiling headers, because the content of whole standard library is huge (around a million lines and growing) and adds compilation time. In a big projects that may add minutes and hours of time to compile.