C++ Logo

std-proposals

Advanced search

Re: Pure value templates

From: Barry Revzin <barry.revzin_at_[hidden]>
Date: Mon, 21 Sep 2020 17:10:33 -0500
On Mon, Sep 21, 2020 at 4:16 PM Richard Hodges via Std-Proposals <
std-proposals_at_[hidden]> wrote:

>
>
> On Mon, 21 Sep 2020 at 22:44, Ramkumar Ramachandra via Std-Proposals <
> std-proposals_at_[hidden]> wrote:
>
>> There's however a problem doing that with my code:
>>
>
> Better to compute the extent in a constexpr function I think:
>
> https://godbolt.org/z/747csf
>

Unfortunately, this is not a good idea since it limits your ability to
actually invoke it.
https://brevzin.github.io/c++/2020/02/05/constexpr-array-size/

It's more useful (though less ergonomic) as a variable template.

Barry

Received on 2020-09-21 17:10:46