This PR converts 149 silent reinterpret_cast’s into explicit reinterpret_cast’s This PR converts 33 silent const_cast’s into explicit const_cast’s
This PR is broken out from #23810, as it appears there is little appetite for the scope of change as outlined in that PR.
0A C-style cast is equivalent to try casting in the following order:
1
2 const_cast(...)
3 static_cast(...)
4 const_cast(static_cast(...))
5 reinterpret_cast(...)
6 const_cast(reinterpret_cast(...))
7
8For a more thorough discussion, see "ES.49: If you must use a cast, use a named cast"
9in the C++ Core Guidelines (Stroustrup & Sutter).
The PR resolves the most critical step of removing implicit c-style casts that act as reinterpret_casts or const_casts, additionally, this PR should be considerably less conflicting than it’s predecessor. I at least hope that it is deemed the value will exceed the cost of conflicts.
If there are any specific areas of the codebase that are heavily conflicting compared to others, I’d be happy to drop those sections of the PR for now.