Coming soon - Get a detailed view of why an account is flagged as spam!
view details

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.

74
When *not* to use constexpr?
Post Body

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?

Author
Account Strength
0%
Account Age
12 years
Verified Email
Yes
Verified Flair
No
Total Karma
54,512
Link Karma
2,985
Comment Karma
44,491
Profile updated: 3 months ago
Posts updated: 7 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
2 years ago