http://d.puremagic.com/issues/show_bug.cgi?id=6517
Summary: [CTFE] ptr++ doesn't work but ++ptr does Product: D Version: unspecified Platform: Other OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: dsim...@yahoo.com --- Comment #0 from David Simcha <dsim...@yahoo.com> 2011-08-17 04:45:24 PDT --- int ctfeFun(const int[] arr) { auto startp = arr.ptr; auto endp = arr.ptr + arr.length; for(; startp < endp; startp++) {} return 0; } const arr = [1, 2, 3]; enum ans = ctfeFun(arr); test9.d(5): Error: pointer expression startp++ cannot be interpreted at compile time test9.d(11): Error: cannot evaluate ctfeFun(arr) at compile time Changing startp++ to ++startp fixes the problem. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------