C++ Logo

std-proposals

Advanced search

Re: RFC: disjoint qualifier

From: Eric Lengyel <lengyel_at_[hidden]>
Date: Tue, 22 Sep 2020 12:22:00 -0700
Yes, some others have also suggested disjoint_cast for the same exact reasons, and I agree.

 

 

From: Std-Proposals <std-proposals-bounces_at_[hidden]> On Behalf Of Andrew Giese via Std-Proposals
Sent: Tuesday, September 22, 2020 9:24 AM
To: std-proposals_at_[hidden]
Cc: Andrew Giese <gieseanw_at_[hidden]>
Subject: Re: [std-proposals] RFC: disjoint qualifier

 

I like the idea of C++ getting its own version of restrict.

 

Sometimes, it is desirable to cast away constness (e.g. for code reuse in an overloaded member function for const and non-const), but there doesn't appear to be any way to cast a variable into disjoint (for example, if I'm dealing with a legacy API that guarantees two pointers I receive are not aliased).

 

So perhaps you should consider also proposing a std::disjoint_cast that will force disjoint.

 

 

Am Fr., 18. Sept. 2020 um 03:38 Uhr schrieb Eric Lengyel via Std-Proposals <std-proposals_at_[hidden] <mailto:std-proposals_at_[hidden]> >:
>
> Standard C++ does not include the “restrict” qualifier from C, and many serious problems arise when attempting to properly incorporate it into the C++ language. The following proposal introduces a superior alternative in the form of a “disjoint” qualifier that functions differently in several important ways. The disjoint qualifier is a clean and natural fit within the established design of the C++ language, and it adds type-safe aliasing controls in a backward-compatible manner.
>
>
>
> http://terathon.com/disjoint_lengyel.pdf
>
>
>
> Please discuss.
>
>
>
> -- Eric Lengyel
>
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden] <mailto:Std-Proposals_at_[hidden]>
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals




Received on 2020-09-22 14:22:04