April 12, 2005 Static array initialization bug. | ||||
---|---|---|---|---|
| ||||
<quote src="D doc"> "Static array contents are initialized to the default initializer for the array element type." </quote> typedef int Type = 12; static Type[2] var = [0:1]; int main(char[][] args) { assert(var[0] == 1); assert(var[1] == 12); // <- assert is here } I am getting assertion on marked line, any advices how to solve ths? |
April 15, 2005 Re: Static array initialization bug. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrew Fedoniouk | -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andrew Fedoniouk schrieb am Tue, 12 Apr 2005 16:00:08 -0700: ><quote src="D doc"> > "Static array contents are initialized to the default initializer for the array element type." ></quote> > > typedef int Type = 12; > static Type[2] var = [0:1]; > > int main(char[][] args) > { > assert(var[0] == 1); > assert(var[1] == 12); // <- assert is here > } > > I am getting assertion on marked line, any advices how to solve ths? Added to DStress as http://dstress.kuehne.cn/run/array_initialization_06.d http://dstress.kuehne.cn/run/array_initialization_07.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCXxwH3w+/yD4P9tIRAqnGAJ9q3e/6B61PZftrGHzxuTOon44dswCfSRbb qky2riASw7KRVi1aRdEC41Q= =2xNb -----END PGP SIGNATURE----- |
Copyright © 1999-2021 by the D Language Foundation