[Issue 3801] CTFE: this.arr[i] cannot be evaluated at compile time for structs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 27 03:44:49 PST 2010


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



--- Comment #2 from Sönke Ludwig <ludwig at informatik.uni-luebeck.de> 2010-02-27 03:44:47 PST ---
Unfortunately, the workaround also errors out with (although I did not check a
current svn build):

test.d(6): Error: this.arr[] = cast(const(int[]))x cannot be evaluated at
compile time


But this gave me finally another idea, which seems to work:

struct test {
  int[1] f;

  this(int x){
    int[] dst = f;
    dst[0] = x;
  }
}

[Now off to some code porting and finally trying out the recent features...
;-)]

-- 
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