August 19, 2007 [Issue 1433] New: in array / slice / range / enum / ... | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=1433 Summary: in array / slice / range / enum / ... Product: D Version: unspecified Platform: All OS/Version: All Status: NEW Keywords: spec Severity: enhancement Priority: P2 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: christian.hartung@yahoo.com.br The in expression can be extended to support things like: int i; ... if(i in [1, 2, 3]) or if(i in [1..5]) or even enum Color { red, blue, green }; if(i in Color) It will test for the existence of the element in the container, returning true if the element is found. If the container is a set of integers, the element must be an integer. If the set is a string, the element must be a char.. An !in expression also is welcome. Obs.: also keep the current in expression for associative arrays, returning a pointer to the element and the opIn and opIn_r. -- |
August 20, 2011 [Issue 1433] in array / slice / range / enum / ... | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=1433 bearophile_hugs@eml.cc changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bearophile_hugs@eml.cc --- Comment #1 from bearophile_hugs@eml.cc 2011-08-20 03:53:18 PDT --- As alternative see bug 6536 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation