You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Same pcmpestri approach as in find_first_of for 1 or 2 byte element. Did not bother making anything for larger characters.
The existing find_first_of was a bit copypasta reduced. Still the _first_ and the _last_ don't share the implementation, it would have been very confusing to iterate in different directions in a single loop.
The new functions have _pos in names to indicate being position based rather than pointer based. They are used in strings only, so pointers would have been extra conversion for no gain. We might add position-based find_first_of or pointer based find_last_of someday, so the naming scheme has provision for this.
Also the vectorization threshold was tuned (even for 8-bytes character, you'll hate it).
Test coverage was also expanded to cover the bug of having basic_string<unsigned long long>.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
π§ Overview
pcmpestri
approach as infind_first_of
for 1 or 2 byte element. Did not bother making anything for larger characters.find_first_of
was a bit copypasta reduced. Still the_first_
and the_last_
don't share the implementation, it would have been very confusing to iterate in different directions in a single loop._pos
in names to indicate being position based rather than pointer based. They are used in strings only, so pointers would have been extra conversion for no gain. We might add position-basedfind_first_of
or pointer basedfind_last_of
someday, so the naming scheme has provision for this.basic_string<unsigned long long>
.β±οΈ Benchmark results