Re: In Expressions

2017-03-05 Thread Basile B. via Digitalmars-d-learn
On Saturday, 4 March 2017 at 19:31:46 UTC, Andrey wrote: On Saturday, 4 March 2017 at 17:57:16 UTC, John Colvin wrote: but to be honest, I would just repeat myself a bit and write if (regionAlign == RegionAlign.top || regionAlign == RegionAlign.bottom) { } That's exactly what I did, just

Re: In Expressions

2017-03-04 Thread Andrey via Digitalmars-d-learn
On Saturday, 4 March 2017 at 17:57:16 UTC, John Colvin wrote: but to be honest, I would just repeat myself a bit and write if (regionAlign == RegionAlign.top || regionAlign == RegionAlign.bottom) { } That's exactly what I did, just wondered - how to do such a thing. Thank's for the detaile

Re: In Expressions

2017-03-04 Thread Meta via Digitalmars-d-learn
On Saturday, 4 March 2017 at 17:11:46 UTC, Andrey wrote: Hello, is there any way to using in expression like in python, e.g. if 4 in [1, 3, 4]: do something My code in D if (regionAlign in [RegionAlign.top, RegionAlign.bottom]) { ... } throws an error: incompatible types for (((cast(

Re: In Expressions

2017-03-04 Thread John Colvin via Digitalmars-d-learn
On Saturday, 4 March 2017 at 17:11:46 UTC, Andrey wrote: Hello, is there any way to using in expression like in python, e.g. if 4 in [1, 3, 4]: do something My code in D if (regionAlign in [RegionAlign.top, RegionAlign.bottom]) { ... } throws an error: incompatible types for (((cast(

In Expressions

2017-03-04 Thread Andrey via Digitalmars-d-learn
Hello, is there any way to using in expression like in python, e.g. if 4 in [1, 3, 4]: do something My code in D if (regionAlign in [RegionAlign.top, RegionAlign.bottom]) { ... } throws an error: incompatible types for (((cast(Widget)this).regionAlign()) in ([top, bottom])): 'RegionA