| ▲ | spacechild1 an hour ago | |||||||
> They make sense but reduce type safety Yes, downcasting can be unsafe and should be used carefully, but what's the alternative? At least in C++ you can't cast between unrelated types without an explicit reinterpret_cast (or C-style cast). | ||||||||
| ▲ | chrchang523 34 minutes ago | parent [-] | |||||||
and you CAN use static_cast to convert from void*; this silently keeps working if you refactor the void* into a matching-type pointer later, while raising a compilation error if you refactor to a different-type pointer. | ||||||||
| ||||||||