Vision for the D language - stabilizing complexity?

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 12 07:40:37 PDT 2016


On 07/12/2016 10:26 AM, H. S. Teoh via Digitalmars-d wrote:
> On Tue, Jul 12, 2016 at 01:33:00AM -0400, Andrei Alexandrescu via Digitalmars-d wrote:
>> On 07/12/2016 01:15 AM, Shachar Shemesh wrote:
> [...]
>>> Casting away immutability is UB in D.
>>
>> I understand. There is an essential detail that sadly puts an
>> anticlimactic end to the telenovela. The unsafe cast happens at
>> allocator level.
> [...]
>
> What's an "unsafe cast"?  I think we're mixing up terminology here,
> which is not helping this discussion.
>
> Is casting away immutable merely *unsafe*, or is it UB?

The subtlety here is that immutable is not being cast away. All data 
that is typed as immutable stays immutable. -- Andrei


More information about the Digitalmars-d mailing list