Sujet : Re: constexpr keyword is unnecessary
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 13. Oct 2024, 19:21:46
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20241013112004.698@kylheku.com>
References : 1 2 3 4 5 6 7
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2024-10-13, Thiago Adams <
thiago.adams@gmail.com> wrote:
Em 10/13/2024 1:39 PM, Kaz Kylheku escreveu:
On 2024-10-11, Thiago Adams <thiago.adams@gmail.com> wrote:
What I am suggesting again is remove the keyword constexpr. make const
do that.
>
Just to remember C++ was already like that before constexpr. In c++
const could be used as constant expressions.
Really?
const int f(int x) { ... }
says that calls to f can be evaluated at compile time?
>
I am comparing what C have so far. Only variables not functions.
What C has so far is just lagging behind the C++ constexpr.
constexpr has to be consistent for variables and functions and
everything else.
Can you do it all with const, while retaining backward compatibility of
programs that don't know anything about the new constexpr meaning
of const?
I am deeply skeptical.