Re:Some dark corners of C
by pmjordan on Sunday March 10, 2013 @06:27AM
(#5351346)
As far as I know, this is exactly the rationale, actually. Say you have:
If I need void*-casting code to compile on both C and C++ compilers, I use a macro like this:
This leaves the conversion to be implicit in C, and uses the stricter static_cast in C++ to catch certain types of likely-unsafe conversions, such as the aforementioned cast from int to pointer.
[ Parent
| on HN ]
There are no comments on this comment yet.