C++ Logo

std-discussion

Advanced search

Re: consteval functions and constexpr parameters

From: language.lawyer_at <language.lawyer_at_[hidden]>
Date: Wed, 6 Jan 2021 16:19:52 +0300
https://stackoverflow.com/questions/56130792/will-consteval-functions-allow-template-parameters-dependent-on-function-argumen

On 06/01/2021 16:04, Yongwei Wu via Std-Discussion wrote:
> As outlined in this article
> https://mpark.github.io/programming/2017/05/26/constexpr-function-parameters/,
> C++ does not have constexpr parameters—we cannot use the arguments in a
> constexpr function as constexpr variables. That rules out many valid
> usages, and we had to use ugly hacks. Now we have consteval in C++20, and
> consteval functions are supposed to be evaluated only at compile time, is
> there any obstacle to regarding their parameters as constexpr?
>
> Is there a real technical difficulty, or is it only that no one has
> proposed it?
>
> Best regards,
>
> Yongwei
>
>

Received on 2021-01-06 07:20:40