C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Revising #pragma once

From: Jeremy Rifkin <rifkin.jer_at_[hidden]>
Date: Tue, 27 Aug 2024 23:32:43 -0500
> Another question is whether the comparison should be post translation
> phase 1.

I gave this some thought while drafting the proposal. I think it comes
down to whether the intent is single inclusion of files or single
inclusion of contents.

Jeremy

On Tue, Aug 27, 2024 at 3:39 PM Tom Honermann via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> On 8/27/24 4:10 PM, Thiago Macieira via Std-Proposals wrote:
> > On Tuesday 27 August 2024 12:35:17 GMT-7 Andrey Semashev via Std-Proposals
> > wrote:
> >> The fact that gcc took the approach to compare file contents I consider
> >> a poor choice, and not an argument to standardize this implementation.
> > Another question is whether a byte comparison of two files of the same size is
> > expensive for compilers.
> >
> > #once ID doesn't need to compare the entire file.
>
> Another question is whether the comparison should be post translation
> phase 1. In other words, whether differently encoded source files that
> decode to the same sequence of code points are considered the same file
> (e.g., a Windows-1252 version and a UTF-8 version). Standard C++ does
> not currently allow source file encoding to be observable but a #pragma
> once implementation that only compares bytes would make such differences
> observable.
>
> Tom.
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2024-08-28 04:32:57