[Issue 3801] New: CTFE: this.arr[i] cannot be evaluated at compile time for structs
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Feb 14 07:45:34 PST 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3801
Summary: CTFE: this.arr[i] cannot be evaluated at compile time
for structs
Product: D
Version: 2.040
Platform: Other
OS/Version: Windows
Status: NEW
Severity: blocker
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: ludwig at informatik.uni-luebeck.de
--- Comment #0 from Sönke Ludwig <ludwig at informatik.uni-luebeck.de> 2010-02-14 07:45:33 PST ---
A static array contained inside a struct is not accessible during CTFE. Because
of this, it seems impossible (since some versions) to define compile-time
constants of such structures (for example tuple vectors or matrices).
---
struct S {
int arr[1];
this(int x){
arr[0] = x; // (this.arr[0u]) = x cannot be evaluated at compile time
}
}
immutable S s_constant = S(1); // Error: cannot evaluate __ctmp1.this(1) at
compile time
---
--
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