From: Thiago Adams <thiago.adams@gmail.com> | |
Date: 11 Oct 2024 20:25:19 Hong Kong Time | |
Newsgroup: news.alt119.net/comp.lang.c | |
Subject:
constexpr keyword is unnecessary |
|
NNTP-Posting-Host: null |
I think constexpr keyword is unnecessary. 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. |