Sujet : Re: constexpr keyword is unnecessary
De : thiago.adams (at) *nospam* gmail.com (Thiago Adams)
Groupes : comp.lang.cDate : 19. Oct 2024, 16:18:04
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vf0ijd$3u54q$1@dont-email.me>
References : 1 2
User-Agent : Mozilla Thunderbird
Em 10/18/2024 8:54 PM, Keith Thompson escreveu:
Thiago Adams <thiago.adams@gmail.com> writes:
I think constexpr keyword is unnecessary.
Sure, most language features are strictly unnecessary.
Anything you do with it could/should be done with const.
No, absolutely not.
If not, do you have a sample where, using "const" as "constexpr", would create problems?
The sample I know is VLA.
const int c = 2;
int a[c]; //a is VLA because c is not a constant expression.
But this is not enough to convince me because it is better not to be a VLA here.