Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance std.string.indexOf(startIdx) with ranges #3178

Merged
merged 1 commit into from
Apr 26, 2015

Conversation

WalterBright
Copy link
Member

Upgrade http://dlang.org/phobos/std_string.html#.indexOf.2 to handle input ranges as well as arrays.

{
if (startIdx < s.length)
static if (isSomeString!Range || hasSlicing!Range)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also needs && hasLength!Range, although it could also be amended to have a path that uses slicing to search in infinite ranges that support such.

@JakobOvrum
Copy link
Member

Didn't see the updated commit; LGTM.

@JakobOvrum
Copy link
Member

Auto-merge toggled on

JakobOvrum added a commit that referenced this pull request Apr 26, 2015
enhance std.string.indexOf(startIdx) with ranges
@JakobOvrum JakobOvrum merged commit 553f697 into dlang:master Apr 26, 2015
@WalterBright WalterBright deleted the indexOf-Range2 branch April 26, 2015 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants