digitalmars.D.learn - order of declaration/definition
- John Colvin (6/6) Aug 23 2015 enum A = 1;
- "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> (2/8) Aug 24 2015 No.
- vitus (16/22) Aug 27 2015 Beter:
- Daniel =?UTF-8?B?S296w6Fr?= via Digitalmars-d-learn (3/34) Aug 27 2015 works ok for me
- vitus (2/7) Aug 27 2015 V tom je ten problém :)
- Daniel =?UTF-8?B?S296w6Fr?= via Digitalmars-d-learn (22/32) Aug 27 2015 Jo mas pravdu :) po prepsani na:
enum A = 1; enum B = C; //Error static if(A) enum C = 0; enum D = C; //OK Is order supposed to matter here?
Aug 23 2015
On Monday, 24 August 2015 at 01:01:13 UTC, John Colvin wrote:enum A = 1; enum B = C; //Error static if(A) enum C = 0; enum D = C; //OK Is order supposed to matter here?No.
Aug 24 2015
On Monday, 24 August 2015 at 01:01:13 UTC, John Colvin wrote:enum A = 1; enum B = C; //Error static if(A) enum C = 0; enum D = C; //OK Is order supposed to matter here?Beter: enum E = 1; struct Foo{ enum X1 = E; static if(1) enum E = 2; enum X2 = E; } static assert(Foo.X1 != Foo.X2); class Bar{ enum X1 = __traits(isAbstractClass, typeof(this)); static if(1) abstract void bar(); enum X2 = __traits(isAbstractClass, typeof(this)); } static assert(Bar.X1 != Bar.X2); mixins has same problem.
Aug 27 2015
On Thu, 27 Aug 2015 13:01:02 +0000 vitus via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> wrote:On Monday, 24 August 2015 at 01:01:13 UTC, John Colvin wrote:works ok for meenum A = 1; enum B = C; //Error static if(A) enum C = 0; enum D = C; //OK Is order supposed to matter here?Beter: enum E = 1; struct Foo{ enum X1 = E; static if(1) enum E = 2; enum X2 = E; } static assert(Foo.X1 != Foo.X2); class Bar{ enum X1 = __traits(isAbstractClass, typeof(this)); static if(1) abstract void bar(); enum X2 = __traits(isAbstractClass, typeof(this)); } static assert(Bar.X1 != Bar.X2); mixins has same problem.
Aug 27 2015
On Thursday, 27 August 2015 at 13:14:24 UTC, Daniel Kozák wrote:On Thu, 27 Aug 2015 13:01:02 +0000 vitus via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> wrote:V tom je ten problém :)works ok for me
Aug 27 2015
On Thu, 27 Aug 2015 13:26:11 +0000 vitus via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> wrote:On Thursday, 27 August 2015 at 13:14:24 UTC, Daniel Kozák wrote:Jo mas pravdu :) po prepsani na: enum E = 1; struct Foo{ enum X1 = E; enum E = 2; enum X2 = E; } static assert(Foo.X1 != Foo.X2); class Bar{ enum X1 = __traits(isAbstractClass, typeof(this)); abstract void bar(); enum X2 = __traits(isAbstractClass, typeof(this)); } static assert(Bar.X1 != Bar.X2); void main() { import std.stdio; writeln(Foo.X1, Foo.X2); writeln(Bar.X1, Bar.X2); } to uz vidim ;-)On Thu, 27 Aug 2015 13:01:02 +0000 vitus via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> wrote:V tom je ten problém :)works ok for me
Aug 27 2015