C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Utilizing constant folding with provable if statements

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Wed, 23 Aug 2023 20:34:02 -0400
On Wed, Aug 23, 2023 at 8:19 PM Jan Schultke via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> https://gist.github.com/Eisenwave/1520b4bc51b402936fa7c9c653ea29f3

>From the proposal:

> In the above example, it is possible that the caller of the function provided a `base` which is a constant expression. If so, the compiler must know the value

No it does not "must know the value". It would only "know the value"
if it has decided to inline the function call.

This proposal really feels like it wants to just be conditionally
constexpr parameters. Or just being able to overload on a parameter
being a constant expression (which is really the goal here).

Received on 2023-08-24 00:34:15