isocpp / isocpp/CppCoreGuidelines
Example for T.122
Open
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 45.3k
- Forks
- 5.6k
- PR merge metrics
- No merged PRs in 30d
Description
T.122: Use templates (usually template aliases) to compute types at compile time
Example
template <size_t bits>
using int_least_bits_t = std::conditional_t<bits <= 32, int32_t, int64_t>;
int_least_bits_t<minimum_bits> x{ /* ... */ };
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
Locate the T.122 guideline in the CppCoreGuidelines repository and read its surrounding examples and formatting. Add the provided template-alias example in the appropriate place; done means T.122 includes a clear example demonstrating compile-time type computation.
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
- 45/100