Liste des Groupes | Revenir à cl c |
Am 11.10.2024 um 14:25 schrieb Thiago Adams:What I am saying is make const do that. No need for a new keyword.
I think constexpr keyword is unnecessary.const doesn't replace constexpr. constexpr is when you want to
Anything you do with it could/should be done with const.
Even without const , one object like (struct point){.x=1, .y=0} is a constant in my view.
So, for instance, no need for (constexpr struct point){.x=1, .y=0} here.
The VLA could have been the motivation for a new keyword, but I don’t think it matters.
On the other hand, (static struct point){.x=1, .y=0} makes sense.
If constexpr were "no-storage" I think it would make sense but it is not.
assure that the variable is compile-time generated. You can't
enforse this constraint with const.
But I find all these attempts to modernize C hopeless. C wantsconstant expression make sense in C. It is not new, it is very old.
to remain a minimalist language and is therefore light years
behind other languages. For me, C is intended to be used when
a more advanced lanugage is not available.
Les messages affichés proviennent d'usenet.