C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Function only accepts parameter that will persist

From: Thiago Macieira <thiago_at_[hidden]>
Date: Mon, 06 May 2024 11:15:11 -0700
On Monday 6 May 2024 10:19:23 GMT-7 Frederick Virchanza Gotham via Std-
Proposals wrote:
> Firstly I
> think the Standard should mandate that a constexpr function written as
> follows:
>
> constexpr bool Func(char const *const arg)
> {
> if consteval
> {
> return true;
> }
> else
> {
> return false;
> }
> }

Why would it ever need to mandate that? Why should EVERY SINGLE constexpr
function have to have a consteval-only portion?

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Principal Engineer - Intel DCAI Cloud Engineering

Received on 2024-05-06 18:15:16