What's the replacement for this array initialization: "ubyte[4096] window =0;"

Ali Çehreli acehreli at yahoo.com
Thu Feb 21 20:26:56 PST 2013


On 02/21/2013 08:10 PM, Marco Leise wrote:
 >    struct ExpandData
 >    {
 >      /// Last seen bytes during expansion.
 >      ubyte[4096] window = 0;
 >      ...
 >    }
 >
 >
 > I noticed in 2.062 this code doesn't work anymore. The
 > compiler still does the initial type conversion of 0 from int
 > to ubyte, but the assignment fails with:
 >
 >    cannot implicitly convert expression (cast(ubyte)0u) of type
 >    ubyte to ubyte[4096LU]

There must be something else. The same code compiles with the released 
dmd 2.062 here. Are you using the latest dmd at github?

Ali



More information about the Digitalmars-d-learn mailing list