digitalmars.D.bugs - [Issue 20166] New: among should have an overload for fixed-length
- d-bugmail puremagic.com (20/20) Aug 24 2019 https://issues.dlang.org/show_bug.cgi?id=20166
https://issues.dlang.org/show_bug.cgi?id=20166 Issue ID: 20166 Summary: among should have an overload for fixed-length arrays Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: phobos Assignee: nobody puremagic.com Reporter: simen.kjaras gmail.com Currently, one needs to use aliasSeq or aliasSeqOf to define the list of values for among to look through. When defining a list of elements that will be used elsewhere, a fixed-length array is often more useful, and this dance to convert between the two is not helping anyone. IOW, this should compile: enum brackets = ['(', '[', '{', '}', ']', ')']; assert('('.among(brackets)); --
Aug 24 2019