[Development] Using '#pragma once' instead of include guards?
Christian Kandeler
christian.kandeler at qt.io
Mon Oct 10 17:43:53 CEST 2022
On 10/10/22 17:13, Thiago Macieira wrote:
> The biggest problem we used to have was installing builds that had
> include
> paths pointing to both the source and installation directory. With
> preprocessor guards, only one of the two would actually get included; with
> #pragma once, the files are actually different so both would get included,
> causing a build error.
Was this really verified or just a guess? Use of #pragma once is rather
wide-spread, and so is implementing header precedence via include path
order, so one would think lots of project would have problems if that
combination didn't work.
Christian
More information about the Development
mailing list