Liste des Groupes | Revenir à cl c |
Em 10/18/2024 8:54 PM, Keith Thompson escreveu:What practical difference would it make? Can you think of any difference between local variables "a" and "b" defined like this?Thiago Adams <thiago.adams@gmail.com> writes:If not, do you have a sample where, using "const" as "constexpr", would create problems?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.
>
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.
Les messages affichés proviennent d'usenet.