[Issue 20166] New: among should have an overload for fixed-length arrays

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 24 23:46:21 UTC 2019


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 at puremagic.com
          Reporter: simen.kjaras at 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));

--


More information about the Digitalmars-d-bugs mailing list