[Issue 17634] variadic overload of std.algorithm.searching.countUntil should return which needle was found

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Sep 1 21:23:15 UTC 2017


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

--- Comment #2 from b2.temp at gmx.com ---
(In reply to b2.temp from comment #1)
> "dropExactly(c).startWith(...)" would allow to find the needle
> 
> also we can imagine a struct-based return type that doesn't break the
> current code:
> 
> struct countUntilResult()
> {
> ptrdiff_t pos; size_t index;
> }

Something like

struct countUntilResult()
{
    ptrdiff_t pos; 
    size_t index;
    alias pos this;
}

--


More information about the Digitalmars-d-bugs mailing list