compile time opCall array assignment

strtr strtr at spam.com
Thu Feb 25 13:15:31 PST 2010


struct S{
	int[2] arr = 0;

	static S opCall( int i1_, int i2_) {
		S res = void;
		res.arr[0] = i1_;
		res.arr[1] = i2_;
		return res;
	}
}

const S CS= S(0,0);

Why can't this be evaluated at compile time?
(And how do I fix it :))



More information about the Digitalmars-d-learn mailing list