In Expressions

Andrey via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Mar 4 09:11:46 PST 2017


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])): 'RegionAlign' and 'RegionAlign[]'


More information about the Digitalmars-d-learn mailing list