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

Since const can be cast away, it's useless for checking.



const can be cast away, auto can have some really nasty behavior, constexpr doesn't have to do anything, inline can be ignored, [[nodiscard]] can be discarded, exceptions can be thrown in noexcept functions, etc. Almost everything in C++ can be bypassed in one way or another.


D can cast away const, but not in @safe code. Though we are considering revising this so it can only be done in @system code.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: