I am reading Accelerated C++ and there are lines written there about standard header
It is worth noting that although we refer to our own headers as header files, we refer to the implementation-supplied headers as standard headers rather than standard header files. The reason is that header files are genuine files in every C++ implementation, but system headers need not be implemented as files.
My first question is that if we are running windows OS and in one hand we have codeblocks (GNU compiler) and in second we have turbo c++. So do we consider them as separate implementation?
My second question is that how actually these standard headers are implemented?
The point the author is making is that the compiler, should it wish to do so, could implement #include <string>
internally in the compiler, without there ever being any file called string
in the system that compiles your code. In reality, I'm not aware of any compiler that DOES implement this, but it's certainly viable from what the C++ standards perspective.
Each compiler vendor, such as GNU and Free Software Foundation for gcc, the people at Illinois University behind clang, the people at Microsoft, Borland, IBM, Intel, etc that produce a compiler will produce "an implementation" of a compiler. If I write my own C++ compiler that will be an implementation. I happen to have my own compiler for the language Pascal (written in C++ and using LLVM as the backend) - which is an implementation of the language Pascal - and like all implementations, it follows the standard, but has some "implementation defined" features. All implementations will have some things that are "based on what the implementor choose to do", for several possible reasons:
int
or Pascal's integer
is not specified beyond "it must be at least this big ...", so as long as the minimum criteria is fulfilled, the implementor can do what he/she/they chooses.