On 12/14/2013 08:30 PM, Walter Bright wrote:
On 12/14/2013 9:19 AM, Timon Gehr wrote:
On 12/11/2013 12:46 AM, Walter Bright wrote:
On 12/10/2013 3:04 PM, Timon Gehr wrote:
Malloc is part of the language runtime. Everything needed is known
about it, in
particular that it is pure (in the D sense). Also, the source code of
malloc
will not be standard C code.

All right, so write your own storage allocator. How are you going to
tell the C compiler that it's pure?

How about the D compiler?

You can cast the result to const/immutable, which is why the casting is
possible. It tells the compiler things that cannot be deduced.

I cannot cast data from my own storage allocator to immutable because the behaviour will be undefined.

http://dlang.org/const3.html

Is this a documentation bug? What should be the actual rules?

Reply via email to