C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Revising #pragma once

From: Jens Maurer <jens.maurer_at_[hidden]>
Date: Tue, 27 Aug 2024 18:07:07 +0200
On 27/08/2024 17.53, Sebastian Wittmeier via Std-Proposals wrote:
> Hi Gašper,
>
>> #pragma once is unimplementable.
>
> That may be the case, nevertheless "all" compilers offer it.
>
> Why not make the notion, whether a file is the same implementation-defined.
>
>
>
> Everybody deeply involved in large build systems and farms and the ones doing the company C++ Coding Guidelines knows about the pitfalls with hard links and can judge, whether it should be allowed;
>
> everybody else would perhaps use #pragma once even now without standardization.
>
>
> What risks would you see due to standardization for which user group?

We seem to agree that "#pragma once" is not the way to go for large
projects. Why should we give the impression we support and/or recommend
using "#pragma once" when that's actually bad advice when a user moves
from "toy project" to "large project", e.g. by being hired by Gasper?

Jens

Received on 2024-08-27 16:07:14