Re:Why Safety Profiles Failed
by WalterBright on Friday October 25, 2024 @03:02PM
(#41948510)
Since const can be cast away, it's useless for checking.
[ Parent
| on HN ]
Re:Why Safety Profiles Failed
by SubjectToChange on Friday October 25, 2024 @04:28PM
(#41949347)
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.
Re:Why Safety Profiles Failed
by WalterBright on Friday October 25, 2024 @05:40PM
(#41950077)
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.