On Sunday 23 January 2011 07:12:34 Andrei Alexandrescu wrote:
> On 1/23/11 1:22 AM, Jim wrote:
> > Andrei Alexandrescu Wrote:
> >> I suspect there might be a simple and intuitive way to define a family
> >> of functions that give you whatever portions of the find you're
> >> interested in (before, match, after, before and match, match and after).
> >> That could be either a naming convention or a template argument. Any
> >> ideas, let me know.
> > 
> > splitAt
> > splitBefore
> > splitAfter
> > 
> > ?
> 
> That's a good suggestion, thanks. One issue is that if the element type
> of the range is integral, there is confusion (did you mean to split at
> position k?).
> 
> I decided to go with these:
> 
> http://d-programming-language.org/cutting-edge/phobos/std_algorithm.html#fi
> ndSplit

That definitely seems like a good solution.

- Jonathan M Davis

Reply via email to