[Issue 3888] Version of find() which returns the range _before_ what was found

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 16 12:19:12 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3888


Shin Fujishiro <rsinfu at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rsinfu at gmail.com


--- Comment #1 from Shin Fujishiro <rsinfu at gmail.com> 2010-11-16 12:17:58 PST ---
I often want both parts before and after a needle at the same time.  So how
about bisect()?  It returns a tuple of the two subranges: (before, after).

For example:

  assert(bisect([ 1,2,3,4,5 ], 3) == tuple([ 1,2 ], [ 3,4,5 ]));

Another name might be appropriate seeing issue 4787 though.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list