Byte Array Literal

2014-10-09 Thread Anibal via Digitalmars-d-learn
Hi everyone, I'm just starting with D and i need a way to declare a byte array something like: byte[] arr = [ 0x00, 0xA4, 0x04]; This throws a int[] to byte[] cast error Tried also these ones byte[] arr = \x00\xA4\x04; byte[] arr = [ '\x00', '\xA4', '\x04']; byte[] arr = [ u'\x00', u'\xA4',

Re: Byte Array Literal

2014-10-09 Thread Anibal via Digitalmars-d-learn
On Thursday, 9 October 2014 at 15:41:48 UTC, bearophile wrote: You want ubytes (unsigned bytes) because 0x04 is 164 that is bigger than byte.max. I'd like bytes to be named sbyte and ubyte in D, but Walter has refused this. Bye, bearophile Got it to work, thanks a lot!

Forward Reference

2014-10-09 Thread Anibal via Digitalmars-d-learn
Hi everyone, I'm trying to something like a tree structure. The following: import std.container; class Tree { private SList!Tree subTree; } Produces: class Tree no size yet for forward reference. How i should proceed in order to keep this declaration? Thanks a lot! PD: (You guys

Re: Forward Reference

2014-10-09 Thread Anibal via Digitalmars-d-learn
On Thursday, 9 October 2014 at 19:29:13 UTC, ketmar via Digitalmars-d-learn wrote: On Thu, 09 Oct 2014 19:04:55 + Anibal via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Hi everyone, I'm trying to something like a tree structure. The following: import std.container