[Issue 10763] (&x)[0 .. 1] doesn't work in CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 12 14:17:01 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10763



--- Comment #1 from Don <clugdbug at yahoo.com.au> 2013-08-12 14:16:59 PDT ---
This restriction is intentional. It's a consequence of strictly enforcing C's
pointer arithmetic rules.
You can only slice a pointer that you can perform pointer arithmetic on.

Where x is a variable, C does not guarantee that &x + 1 is a legal address.
(For example, it might be 0, if x is at the end of the address space).

(Enforcing C's pointer arithmetic enormously simplifies the implementation.
Allowing this would create a huge number of special cases).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list