Re: Compilation depends on class methods order

2013-12-20 Thread kdmult
On Friday, 20 December 2013 at 08:03:26 UTC, FreeSlave wrote: Make first read function templated too like this: long read()( ubyte* bytes, long len ) In fact, there are workarouns. But why the order of the declarations has an effect on the compilation result. Namely, if the templated

Re: Compilation depends on class methods order

2013-12-20 Thread kdmult
On Friday, 20 December 2013 at 08:42:34 UTC, Andrej Mitrovic wrote: On 12/20/13, kdmult kdm...@ya.ru wrote: But why the order of the declarations has an effect on the compilation result. I think you should file this as a bug. Done. https://d.puremagic.com/issues/show_bug.cgi?id=11785

Re: local variable naming convention

2013-12-20 Thread kdmult
On Friday, 20 December 2013 at 09:15:26 UTC, Boyd wrote: this(int x, int y) { X = x; Y = y; } So now my question is, how do you distinguish between member and local vars in such cases? this(int x, int y) { this.x = x; this.y = y; }

Compilation depends on class methods order

2013-12-19 Thread kdmult
Hi, Why compilation depends on order of method declarations? The following test case does not compile. However, if we change the order of the 'read' methods in class InputStream below then compilation will not fail. Is it a bug? --- module test; import std.traits : isBasicType; import

Re: tuple parameter fwd

2013-08-06 Thread kdmult
On Tuesday, 6 August 2013 at 05:07:51 UTC, Ali Çehreli wrote: On 08/05/2013 09:51 PM, kdmult wrote: On Monday, 5 August 2013 at 18:45:49 UTC, kdmult wrote: class A(P...) {} class B(R = A!P, P...) {} P... should be rightmost, so how can I use it in the preceding parameter? The default

Re: tuple parameter fwd

2013-08-06 Thread kdmult
On Tuesday, 6 August 2013 at 09:53:33 UTC, Ali Çehreli wrote: Do you mean that when P[0] is already an instance of A, then R should be P[0]. Otherwise, R should be A!P? If so, the following works: class A(P...) { pragma(msg, \nA: ~ P.stringof); } class BImpl(R, P...) { pragma(msg,

tuple parameter fwd

2013-08-05 Thread kdmult
Hi, I would like to use a tuple template parameter in the default value of another template parameter in the same class declaration as follows. class A(P...) {} class B(R = A!P, P...) {} P... should be rightmost, so how can I use it in the preceding parameter? Thanks.

Re: tuple parameter fwd

2013-08-05 Thread kdmult
On Monday, 5 August 2013 at 18:45:49 UTC, kdmult wrote: class A(P...) {} class B(R = A!P, P...) {} P... should be rightmost, so how can I use it in the preceding parameter? The default parameter value doesn't make sense as it's shown above. Actually I want to port C++ code which looks