4 ms·
I know what everything does and what everything should be I used to be like that, but turns out after 5 years not looking at a piece of code you don't know any
by stinos 7y ago
I know what everything does and what everything should be
I used to be like that, but turns out after 5 years not looking at a piece of code you don't know anything anymore (well at least I don't) and then change something only to have something else blow up because, hey, C-style casts ftw right, less typing and less caring.
The other casts at least offer some protection against that at compile-time. There's already enough loopholes in C++ that I'd rather have the least worries possible so now I just do the right thing and use the right cast. Heck I might even add a bunch of static_asserts for casts of which I know they'll only be ok if both types are the same size and layout for instance. Plus at the same time they serve as documentation of what I meant when writing he cast. Saved me a bunch of times already.