On Monday, 10 October 2022 13:20:56 PDT Henry Skoglund wrote:
> But perhaps there could be use of #pragma once anyway, as a way to
> detect those duplicate files? Say something like this at the top of an
> .h file:
>
> #pragma once
> #if defined QGLOBAL_H
> #error "Multiple instances of qglobal.h
Also worth considering
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rs-guards
SF.8:
> Note Some implementations offer vendor extensions like #pragma once
> as alternative to include guards. It is not standard and it is not
portable.
> It injects the hosting machine’s filesystem
On 2022-10-10 21:27, Thiago Macieira wrote:
...
This situation is annoying either way. With include guards, you will get a
working build, but you may spend some time trying to figure out why the changes
you're making to the headers aren't taking effect. With the pragma, you get
hard build errors
My two bits as a user of Qt. Please make sure any exposed headers use the
old-school guards and NOT the #pragma once.
I don’t care how the internal Qt headers work. However, Ive been burned too
many times by the "known issues" of the #pragma once to want to use them.
The problem isn’t if the
On Monday, 10 October 2022 08:43:53 PDT Christian Kandeler via Development
wrote:
> 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
On 10.10.2022 12:07, Eike Ziller via Development wrote:
From what I see, it should in practice be ok to use. But perhaps I’m missing
something. Does anything speak against using ‘#pragma once’ in new files?
Just for reference, we are using it without issues in Qt Creator since 2016.
(But of
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
On Monday, 10 October 2022 02:55:20 PDT Volker Hilsheimer via Development
wrote:
> Hi,
>
>
> We are using `#pragma once` in a number of examples and tests in the Qt
> source tree, but I don’t think we have officially endorsed it in favour of
> explicit include guards.
> #pragma once is
My question was for the developer's own plugins. Are these tools meant for
the developer to test their QML importing their plugins? It might be
surprising that it cannot find the plugins they've just installed to
QML_PLUGIN_PATH, or worse, finds an older version of them.
Indeed if you actually
> -Original Message-
> From: Development On Behalf Of
> Volker Hilsheimer via Development
> Sent: Monday, 10 October 2022 5:55 PM
> To: development@qt-project.org
> Subject: [Development] Using '#pragma once' instead of include guards?
>
> Hi,
>
>
> We are using `#pragma once` in a
I am surprised by the question: "It's non-standard and it's behavior is
undefined" actually should be enough to avoid such feature.
Actually if a reliable implementation of "#pragma once" would be
possible, that feature would have been included in the C++ standard for
a long time already,
> On 10 Oct 2022, at 11:55, Volker Hilsheimer via Development
> wrote:
>
> Hi,
>
>
> We are using `#pragma once` in a number of examples and tests in the Qt
> source tree, but I don’t think we have officially endorsed it in favour of
> explicit include guards.
>
> #pragma once is
Hi,
We are using `#pragma once` in a number of examples and tests in the Qt source
tree, but I don’t think we have officially endorsed it in favour of explicit
include guards.
#pragma once is “non-standard but widely supported” [1], with some caveats,
e.g. when there are multiple header
13 matches
Mail list logo