Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace reinterpret_cast with static_cast. #181

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Commits on Jun 13, 2023

  1. Replace reinterpret_cast with static_cast.

    Conversion between pointers of unrelated types `Source` and `Target`
    can be done with `static_cast` => IMO should be done with `static_cast`
    (in order not to give the impression that `reinterpret_cast` really is needed):
    
      `T *ptr_target = static_cast <T *> (static_cast <void *> (ptr_source));`
    
    IMO `reinterpret_cast` should be used for pointer-to-integral and integral-to-pointer
    conversions (only).
    Adder committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    510eec1 View commit details
    Browse the repository at this point in the history