Re: [D1,static array] fill static multidimensional array.

2010-10-22 Thread spir
On Fri, 22 Oct 2010 01:50:56 + (UTC) %u e...@ee.com wrote: What is the fastest way to fill a static multidimensional array? Looping over all dimension's elements sounds inefficient, especially as a static array is essentially continuous memory. What is the best practice? int[2][2][2]

custom exception type

2010-10-22 Thread spir
Hello, Where can one find descriptions of Throwable, Error, Exception? (I mean, how do you even know they exist?) I could finally guess the constructor must have a string parameter used for error output. Also, is it possible to implicitely reuse the superclass's constructor? I had to write:

Re: custom exception type

2010-10-22 Thread Trass3r
E.this performs nothing new. But without it, I get a compiler error: trial.d(7): Error: constructor trial.E.this no match for implicit super() call in constructor Isn't the constructor inherited like other attributes? I think if you don't provide a constructor a default one is created:

Re: custom exception type

2010-10-22 Thread Lars T. Kyllingstad
On Fri, 22 Oct 2010 13:00:43 +0200, spir wrote: Hello, Where can one find descriptions of Throwable, Error, Exception? (I mean, how do you even know they exist?) I could finally guess the constructor must have a string parameter used for error output. Well, they should be in the

Re: [D1,static array] fill static multidimensional array.

2010-10-22 Thread Trass3r
Somehow I find it surprising that this copies the whole array. arr[] = arr2; Static arrays are value types.

Re: custom exception type

2010-10-22 Thread vano
Although it is somewhat annoying that there is no default value for the msg parameter in the first constructor, it is pretty easy to use the mixin templates to overcome the issue: public mixin template ExceptionCtorMixin() { this(string msg = null, Throwable next = null) { super(msg,

[D1,__traits] D1 has __traits?

2010-10-22 Thread %u
http://www.digitalmars.com/d/1.0/template.html .. assert(__traits(isRef, x[i])); .. static assert(!__traits(compiles, min(3, y) = 10)); These won't compile with my D1 :(

Re: [D1,__traits] D1 has __traits?

2010-10-22 Thread Jacob Carlborg
On 2010-10-22 20:57, %u wrote: http://www.digitalmars.com/d/1.0/template.html .. assert(__traits(isRef, x[i])); .. static assert(!__traits(compiles, min(3, y) = 10)); These won't compile with my D1 :( D1 neither has __traits or auto ref. I guess that the section was accidentally put in the

Re: [D1,__traits] D1 has __traits?

2010-10-22 Thread %u
== Quote from Jacob Carlborg (d...@me.com)'s article On 2010-10-22 20:57, %u wrote: http://www.digitalmars.com/d/1.0/template.html .. assert(__traits(isRef, x[i])); .. static assert(!__traits(compiles, min(3, y) = 10)); These won't compile with my D1 :( D1 neither has __traits or