C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Revising #pragma once

From: Andrey Semashev <andrey.semashev_at_[hidden]>
Date: Fri, 30 Aug 2024 02:39:59 +0300
On 8/30/24 02:22, Jonathan Wakely via Std-Proposals wrote:
>
>
> On Fri, 30 Aug 2024, 00:12 Jeremy Rifkin, <rifkin.jer_at_[hidden]
> <mailto:rifkin.jer_at_[hidden]>> wrote:
>
> I’m not sure they’re trivial to deal with, at least in a way that
> could be standardized. While it's defined source code lives in
> files, the concept of a path/filesystem is not defined outside the
> stdlib. Maybe this could be worded along the lines of if a
> filesystem exists, #pragma once behaves as if by
> std::filesystem::equivalent, otherwise implementation defined. But
> "filesystem" would need to be defined.
>
>
>
> I'm not talking about specifying it. I'm saying that determining whether
> a file foo and a symlink that resolves to foo are "the same" is very
> easy. And likewise, two hard links are very easy to identify as "the same".
>
> The hard problems people have brought up involve a file being mounted at
> two different locations, where the paths are distinct and the device IDs
> or inode numbers are distinct.

There are also filesystem-specific features such as reflinks.

> Describing the hard problems in terms of symlinks and hard links
> suggests a failure to understand the actual problem.

Received on 2024-08-29 23:40:03