C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Revising #pragma once

From: Tiago Freire <tmiguelf_at_[hidden]>
Date: Mon, 2 Sep 2024 10:34:10 +0000
> An #include has no need to tell two files apart. Could you please explain what you're talking about here?

It needs to find a file, not just any file, it needs to find a specific file. Which has an identity, it doesn't go about looking at inodes to figure if the file I specified is the one I actually intended.
You don't go about "hey what happens if network files recycle inodes, include doesn't work".
That include files work based of file paths alone is not a cause for confusion, and so shouldn't pragma once.


________________________________
From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Sent: Monday, September 2, 2024 12:06:28 PM
To: std-proposals_at_[hidden] <std-proposals_at_[hidden]>
Cc: Tiago Freire <tmiguelf_at_[hidden]>; Tom Honermann <tom_at_[hidden]>
Subject: Re: [std-proposals] Revising #pragma once

On Mon, 2 Sept 2024 at 06:24, Tiago Freire via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> Don't define what system calls are needed in the standard.
> This was always going to be platform dependent.
>
> We know for sure that comparing file paths alone would do the trick. Which doesn't even require opening files, the only thing it requires is to exist to register a hit for your #include directive.
> If you need more than that to tell 2 files apart then you can't even guarantee what the "#include" directive is doing.
>
> Is anyone going to argue that "#include" directives are unimplementable?

I continue to fail to understand these arguments along the lines of
"then #include doesn't work either". An #include
has no need to tell two files apart. Could you please explain what
you're talking about here?


Received on 2024-09-02 10:34:13