C++ Logo

std-proposals

Advanced search

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

From: Jan Schultke <janschultke_at_[hidden]>
Date: Tue, 4 Mar 2025 16:16:18 +0100
> If this is proposed for C++, can we go ahead and make enforcement required.

I'm not sure how you envision that. You can put [[reproducible]] on
strlen, and this is allowed despite not having a definition of strlen.
Within the definition of strlen, you could also call other functions
whose definitions are not visible in the current TU, but that's
perfectly fine.

[[reproducible]] and [[unsequenced]] are highly unsafe,
optimization-motivated, developer promises to the compiler.

Received on 2025-03-04 15:16:38