C++ Logo

std-discussion

Advanced search

Re: Seeking a better constexpr

From: Jeremy Ong <jeremycong_at_[hidden]>
Date: Mon, 14 Oct 2019 09:19:30 -0600
Thanks I see now I was confusing consteval and constinit. The issue I have
is that the function arguments of a consteval function are not permitted in
type computation as far as I am aware and thus cannot participate in
modulating the return type.

On Mon, Oct 14, 2019 at 6:10 AM Andrew Schepler <aschepler_at_[hidden]> wrote:

> On Mon, Oct 14, 2019 at 12:58 AM Jeremy Ong via Std-Discussion <
> std-discussion_at_[hidden]> wrote:
>
>> - Proposal: introduce a new function signature decorator called
>> `consteval` (in the spirit of the variable consteval decorator) which is an
>> input into overload resolution.
>>
>
> The draft `consteval` is already a function specifier and is not a
> variable specifier. I haven't looked at it in detail, but I think it does
> much of what you want, except overloading and allowing non-constexpr calls.
> Basically, it demands the evaluation of every call to the function must
> happen at compile time.
>

Received on 2019-10-14 10:21:54