3 ms·
And now I notice that all my uses of static_cast are either with reference or pointer types or for primitive type conversions, but never in a manner that invoke
by SamReidHughes 5y ago
And now I notice that all my uses of static_cast are either with reference or pointer types or for primitive type conversions, but never in a manner that invokes a class's copy constructor.
I didn't realize that C-style casting would behave like static_cast, doing pointer offsets and null checks, if that was available. I had believed it was always reinterpret_cast for pointers.
- steerablesafe 5y agoC-style cast also has a weird "super power" when it tries the `static_cast`: it will happily cast to a pointer of private base (with all the offset adjustments), while normal `static_cast` would fail.