isocpp / isocpp/CppCoreGuidelines

Example for T.122

Open
#2,103 4 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.