On 23.03.2016 22:26, ag0aep6g wrote:
On 23.03.2016 22:18, cy wrote:
On Wednesday, 23 March 2016 at 21:10:49 UTC, ag0aep6g wrote:
[...]
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.

It's stack memory. Its constness isn't any more physical than with `new`.

PS: You can also allocate an explicitly immutable int:

----
b = new immutable(int)(*b + 1);
----

Reply via email to