If I understand const right...

cy via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Mar 23 14:18:41 PDT 2016


On Wednesday, 23 March 2016 at 21:10:49 UTC, ag0aep6g wrote:
> Just to be 100% clear: you're adding to the pointer here,

No, that's what I meant to do.

> b = new int(*b + 1);
Here "b" is pointing to mutable heap allocated data, which got 
cast to constant.

with b = b + 1, it's still constant memory.




More information about the Digitalmars-d-learn mailing list