Floating point init/nan

2014-02-14 Thread Adam S
I seem to be having some difficulty with the nan and init properties of floating point types. Can anyone explain why the following assertions all fail: assert(float.init == float.nan); assert(float.nan == float.nan); assert(float.init == float.init); Thanks.

BitArray oddities

2014-01-09 Thread Adam S
Playing around with BitArray I encountered the seemingly strange interface of --- bool[] b = [0, 1, 0]; BitArray a; a.init(b); --- Is there any reason 'init' is used rather than using a constructor? bool[] b = [0, 1, 0]; BitArray a = BitArray(b); Seems a bit cl

Re: Problems using 'with' statement

2014-01-04 Thread Adam S
On Saturday, 4 January 2014 at 20:56:41 UTC, Adam S wrote: I've encountered an issue using the 'with' statement. Can anyone explain why the following requires that I explicitly specify the variable name, even though it is within a 'with'? class Foo { auto test(a

Problems using 'with' statement

2014-01-04 Thread Adam S
I've encountered an issue using the 'with' statement. Can anyone explain why the following requires that I explicitly specify the variable name, even though it is within a 'with'? class Foo { auto test(alias val)() if (is(typeof(val) == int)){} auto test(alias val)() if (!is(typeof(va