Is there any meaningful downside, on modern compilers, to putting comments starting at the beginning of a header file?
That is, something like the following in great_header.h
:
/*
* this file defines the secret to life
* etc
* (c) 2017 ascended being
*/
#pragma once
#ifndef NAMESPACE_GREAT_HEADER_H_
#define NAMESPACE_GREAT_HEADER_H_
... (actual contents)
#endif // ifndef NAMESPACE_GREAT_HEADER_H_
In the past, I remember caveats such as "#pragma once
only first if it is the first line in the file", and similar rules for include-guard optimization - but I'm not sure if that is still the case. It would be convenient for me, and for automated tools which extract top-of-header info if comments could be the first thing in the file.