C++ Logo

std-proposals

Advanced search

Re: Template qualifiers

From: Barry Revzin <barry.revzin_at_[hidden]>
Date: Wed, 2 Oct 2019 07:29:43 -0500
On Tue, Oct 1, 2019 at 12:56 PM Phil Bouchard via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> [I apologize for my mistakes, I wrote the email very quickly]
>
> 2 things here:
>
> 1. "constexpr" would ideally need to be treated like a qualifier. This way
> it could propagate like cv qualifier.
>
constexpr is not part of the *type *system, it cannot be treated like
qualifier. Given:

constexpr int i = 1;
int const j = 2;

The types of i and j are the same, both int const. There is a proposal
(P1045) for constexpr parameters, but there constexpr would work very
differently than the way qualifiers work: a constexpr parameter would [have
to] behave like a template.

If you want to "propagate" constexpr, you just declare your function
constexpr. constexpr is already conditionally constexpr.

Barry

Received on 2019-10-02 07:32:05