isocpp / isocpp/CppCoreGuidelines

Documentation improvements for what to do to address “remove reinterpret_cast usage”.

Open
#1,681 0 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

C++ Core Guideline states that reinterpret_cast is bad but the documentation is not clear on why it is bad and when it is acceptable to allow it.

As an example, this article (among many) explains in simple terms why this form of cast is bad: https://stackoverflow.com/questions/573294/when-to-use-reinterpret-cast.

Perhaps, we should have something like this in the guideline?

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

Start with the C++ Core Guidelines guidance on reinterpret_cast and compare it with the linked Stack Overflow article. The documentation is done when it clearly explains why reinterpret_cast is discouraged and identifies when its use may be acceptable.

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
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.