This post has been de-listed (Author was flagged for spam)
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Constant expressions are easily the part of C I understand the least (or at least, my biggest "known unknown"), so forgive my ignorance.
Should I be declaring everything constexpr
? I was recently writing some file format handling code and when it came time to write a const variable to hold some magic numbers I wasn't sure if there was any downside to doing this vs using static const
or extern const
. I understand a couple of const globals is not a make or break thing, but as a rule of thumb?
There are a million blog posts about "you can do this neat thing with constexpr" but few or none that explore their shortcomings. Do they have any?
Subreddit
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/cpp/comment...