3 ms·
Since const can be cast away, it's useless for checking.
by WalterBright 2y ago
Since const can be cast away, it's useless for checking.
- SubjectToChange 2y agoconst 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.
- WalterBright 2y agoD can cast away const, but not in @safe code. Though we are considering revising this so it can only be done in @system code.