On Sunday, 15 November 2015 at 14:23:05 UTC, Jonathan M Davis wrote:
As I mentioned, he's okay with changing the language to make the casts well defined. -- Andrei

Well, that's a big change, since it pretty much means that D's const isn't physical const anymore, and Walter has been _very_ insistent about that in the past - to the point that he's argued that C++'s const is outright useless because it isn't physical const. If casting away const and mutating is well-defined behavior, then we basically have C++'s const except that it's transitive ...

Casting away _const_ is already legal if programmer can himself guarantee underlying object has mutable origin (i.e. not available via immutable reference), by the very definition of const. It is casting away immutable and mutating that is strictly UB.

Reply via email to