3 ms·
Yeah, this is why I emphasized that these are prescriptions tailored to my personal usecases and style, not something that's supposed to work for everyone. I do
by keldaris 6y ago
Yeah, this is why I emphasized that these are prescriptions tailored to my personal usecases and style, not something that's supposed to work for everyone. I don't do anything remotely Java-related, so I have no opinion on your JNI example.
On the latter point - yes, C-style casts are a broader concept than static_cast. In practice, as I said in another comment, the stricter constraints of static_cast have never prevented me from making a bug, so I don't view that as an advantage that would justify the extra verbosity. I do write custom allocators a lot and mostly find myself just using C-style casts there - that code already tends to be almost entirely C anyway and the logic of the casts tends to be extremely obvious from the context. If you really care about greppability to a religious extent, I suppose this is an argument for reinterpret_cast - I just don't find it convincing, personally.