Quote Originally Posted by cpjust View Post
So in the case where you'd actually want to include multiple times, they could have added a #pragma many statement (the opposite of #pragma once).
I disagree. The bottom line is that the programmer has to understand what will happen when any given input file is fed to the compiler. Introducing #pragma's (which are a standard means of allowing compiler specific extensions) to work around lack of programmer understanding is not a particularly good approach.

The basic issue here is that the preprocessor works by doing text substitution, whereas the C++ (and C) language are token based. The advocates of things like #pragma once tend to incorrectly assume the preprocessing phase honours rules of the language accepted by the compilation phase (hence the fact that such things affect lexical analysis by the compiler).

Quote Originally Posted by cpjust View Post
That way in 99.999% of header files where you don't want it to be included more than once, you don't have to worry about adding include guards (which is a common noob mistake), and only in the rare cases when you do want it multiply included would you need to add an extra line of code.
But we're stuck with the way it works now, so it doesn't make much difference what I think might have been a good feature...
The real solution is either to properly understand the preprocessor (include guards are something quite consistent with how the preprocessor works) or for the language to include some scheme other than the preprocessor for separating declarations from definitions (which happens with a number of languages other than C or C++). Both approaches have their trade-offs, despite each having strong advocates.