Hacker News new | past | comments | ask | show | jobs | submit login

This is a pretty well-regarded answer, with motivation for why you should not cast [1].

Of course it's not something everyone agrees to, but at least a lot of people seem to.

[1] https://stackoverflow.com/questions/605845/do-i-cast-the-res...




Interesting. Not casting a void pointer return value seems like a bit of a shibboleth for the "C is not a subset of C++" community.


A "better" shibboleth is using "new" and "old" as identifiers. It serves as a good barrier to avoid accidental C++ compilation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: