approvals / approvals/ApprovalTests.cpp
Use constexpr to define version numbers, not #define
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 339
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Description
This arose out of #91.
It would be better to use constexpr instead of #define to define the version number components of this project in code - for type-safety.
Not everyone who uses this project uses it with CMake, so I would stick with our current structure - but I see that constexpr is a nicer - type-safe - way of setting the various version numbers...
I'll set up a separate issue to convert the
#defineapproach in toconstexprinstead...
Originally posted by @claremacrae in https://github.com/approvals/ApprovalTests.cpp/issues/91#issuecomment-589946545
Contributor guide
No contributing guide indexed for this repository
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 the project’s version-number #define declarations and review issue #91 for the original context. Replace the version components with type-safe constexpr definitions, preserving the current structure for users who do not use CMake, and verify that existing version-related checks still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- release
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100