isocpp / isocpp/CppCoreGuidelines
F.4 should only apply to libraries
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 45.3k
- Forks
- 5.6k
- PR merge metrics
- No merged PRs in 30d
Description
F.4: If a function may have to be evaluated at compile time, declare it constexpr
Please don't. The compiler will tell you if and when you actually need to declare it constexpr. Instead of pondering and guessing about this ahead of time, and writing longer code for no reason, just add the keyword when needed.
The one exception to is libraries (of any form). Library interfaces need to be thought out ahead of time, because you don't want library users changing the code.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating guideline F.4 in the C++ Core Guidelines content and read its surrounding explanation. Update the rule so its applicability to libraries is explicit, while preserving the stated rationale; done means the guideline clearly distinguishes library interfaces from ordinary application code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100