Boost logo

Boost :

Subject: Re: [boost] Guidence on #pragma once
From: charleyb123 (charleyb123_at_[hidden])
Date: 2018-11-25 13:02:39

On Sun, Nov 25, 2018 at 5:46 AM Olaf van der Spek via Boost <
boost_at_[hidden]> wrote:

> On Sat, Nov 24, 2018 at 2:01 AM Andrey Semashev via Boost
> <boost_at_[hidden]> wrote:
> > since `#pragma once` is non-standard and not reliable, there's little
> Who has a sane reproducible test case showing the claimed unreliability?

The '#pragma once' discussion occasionally comes up in the Qt community,
and they repeatedly decide to not use it.

It came up again last month, and here is a use case of claimed
unreliability (from Thiago):

> For example, I have ~/src as a bind-mount to ~/dev/src. That means
> ~/src/qt/qt5/qtbase/src/corelib/global/qglobal.h
> ~/dev/src/qt/qt5/qtbase/src/corelib/global/qglobal.h
> are actually the same file, but they aren't for the effects of #pragma once
> because the paths differ.
> Another problem is qcompilerdetection.h, qprocessordetection.h,
> qsystemdetection.h, qtypeinfo.h, etc. which depend on the header guards to
> break the include cycle. Ditto for qlist.h + qstringlist.h and
> qbytearraylist.h

Excerpt from:


Boost list run by bdawes at, gregod at, cpdaniel at, john at