C++ Logo

std-proposals

Advanced search

Re: [std-proposals] [[pure]] attribute

From: Jan Schultke <janschultke_at_[hidden]>
Date: Tue, 4 Mar 2025 09:58:26 +0100
Since no one has mentioned this yet:

C23 already has [[reproducible]] and [[unsequenced]], which are
designed exactly for this purpose. Here is an overview:
https://stackoverflow.com/q/76847905/5740428

There's a reasonable argument that we should have these in C++ for
compatibility and optimization. I wouldn't want to see any novel
design such as [[pure]].

Also note that the C23 attributes closely match [[gnu::pure]] and
[[gnu::const]], although there are some minor differences.

Received on 2025-03-04 08:58:44