Does it make sense in modern compilers to post comments starting at the beginning of the header file?
That is, something like the following in great_header.h :
#pragma once #ifndef NAMESPACE_GREAT_HEADER_H_ #define NAMESPACE_GREAT_HEADER_H_ ... (actual contents) #endif
In the past, I remember caveats such as " #pragma once only first, if this is the first line in the file", and similar rules for optimizing inclusion-protection - but I'm not sure if this is still the case. It would be convenient for me for automated tools that extract top-level information if comments can be first in the file.
source share