
On 24/06/11 11:46, Antony Polukhin wrote:
2011/6/24 Tom Tan<ttan@husky.ca>:
It seems to me the outer #ifdef works for MSVC as well. What's the extra benefit of embedding an inner #pragma once in this case?
In case there is no pragma in header, compiler will open header file again when it is included and will parse it till include guards. If there is a pragma, compiler will not open and parse the file again. So pragma can reduce compilation time.
Do you mean Visual C++ specific behaviour? Is location of #pragma relevant? Meaning, having #pragma nested in #ifndef include guard vs. placing it in outer scope, makes difference or not? Best regards, -- Mateusz Loskot, http://mateusz.loskot.net Charter Member of OSGeo, http://osgeo.org Member of ACCU, http://accu.org