C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Revising #pragma once

From: Henry Miller <hank_at_[hidden]>
Date: Tue, 27 Aug 2024 17:26:49 -0500
On Tue, Aug 27, 2024, at 15:36, Ville Voutilainen via Std-Proposals wrote:
> On Tue, 27 Aug 2024 at 23:29, Tiago Freire via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
>>
>> It's a clear-cut case of a feature that industry pretty much converged on, and the standard lagged behind.
>
> The industry refuses to use it because it doesn't work.
>
> Depending on the definition of "the industry" through a particular lens.

Large portions of the industry uses it and find it works great in practice. Large portions of the industry refuse to use it, because there are significant edge cases where it doesn't work.

I take the above facts as evidence that we should put something like #pragma once in the standard, but only if we either make it work in all cases; or understand and mitigate the edge cases. There are many options with trade offs. Some of the proposed mitigations I'm fine with, but others I'm not.

To me there are two important parts. Whatever the rules are, they must be simple enough that a freshman student can get them right on a quiz (which is to say without extensive study or experience). It can't make compile time significantly worse.

Of course if someone makes good progress on tools around modules such that I have hope of seeing everyone roll them out in the near future we don't have to do that. However despite how great modules look so far they look like something that will take many years to roll out in the real world.

Received on 2024-08-27 22:27:10