Join me for an October scary story as we try to find the identity of the scariest C++ cast.
The original inspiration for implementing public_cast came from here. I wrote my own version which is more modern and (IMHO) easier to understand, but I take no credit for the ingenuity (and devilishness) of the basic implementation technique.
[ Ссылка ]
After uploading the video, I realized you could use a trait type, something like public_cast_traits, and specialize it with CxSecret to "store" the member pointer type (int C::*) once, and then just look it up inside public_cast, so you don't have to repeat it at every "call site." That's one possible solution for the part where I said to let me know if you have any ideas.
implicit_cast can be found in boost: [ Ссылка ]
Other stuff:
evil floating point bit level hacking: [ Ссылка ]
Strict Aliasing: [ Ссылка ]
I use the amazing Manim library for animating these videos, and I edit them with Blender and Audacity.
[ Ссылка ]
[ Ссылка ]
[ Ссылка ]
Ещё видео!