C++ mutable in D

Jack Applegame japplegame at gmail.com
Sun Aug 1 06:15:30 UTC 2021


On Friday, 30 July 2021 at 20:09:19 UTC, Tejas wrote:
> Also remember that casting away const is undefined behaviour in 
> D (unlike being defined and supported in C++).

No.
Casting const away IS NOT undefined behavior in both D and C++.
Modifying a const object IS undefined behavior in both D and C++.
There is not much difference between D and C++ in that way.



More information about the Digitalmars-d mailing list