[Issue 19475] New: add a staticIndexOf overload taking a pred

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 11 09:58:48 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19475

          Issue ID: 19475
           Summary: add a staticIndexOf overload taking a pred
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: b2.temp at gmx.com

Overloads of std.meta.staticIndexOf allow only to find an exact needle but in
some case it more useful to get the index of something based on a predicate,
for example to get the index of a compile time value that partially matches
(e.g member value of a struct used as UDA).

It even may be better to name them firstStaticIndexOf lastStaticIndexOf

--


More information about the Digitalmars-d-bugs mailing list