C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] Template qualifiers
From: Barry Revzin (barry.revzin_at_[hidden])
Date: 2019-10-02 07:29:43


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



STD-PROPOSALS list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups