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

--- Comment #0 from S´┐Żnke Ludwig <> 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:
------- You are receiving this mail because: -------

Reply via email to