Skip to content

Implement ranges::search - #896

Merged
Stephan T. Lavavej (StephanTLavavej) merged 11 commits into
microsoft:masterfrom
CaseyCarter:search
Jun 24, 2020
Merged

Implement ranges::search#896
Stephan T. Lavavej (StephanTLavavej) merged 11 commits into
microsoft:masterfrom
CaseyCarter:search

Conversation

@CaseyCarter

Copy link
Copy Markdown
Contributor

Implement helper ranges::_Rewrap_subrange to use in ranges::search and ranges::find_end.

Perma-workaround VSO-1141368, a failure in MSVC to properly handle lifetime extension when binding a temporary returned from a non-static member function to a reference in a constexpr context. (This seems to also affect structured bindings which look similar "under the covers".)

Partially addresses #39.

Implement helper `ranges::_Rewrap_subrange` to use in `ranges::search` and `ranges::find_end`.

Perma-workaround VSO-1141368, a failure in MSVC to properly handle lifetime extension when binding a temporary returned from a non-static member function to a reference in a constexpr context. (This seems to also affect structured bindings which look similar "under the covers".)

Partially addresses microsoft#39.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One minuscule nit

Comment thread stl/inc/algorithm Outdated
Comment thread tests/std/tests/P0896R4_ranges_alg_search/test.cpp Outdated
Comment thread tests/std/tests/P0896R4_ranges_alg_search/test.cpp Outdated
Comment thread tests/std/tests/P0896R4_ranges_alg_find_end/test.cpp
Comment thread stl/inc/xutility Outdated
Comment thread stl/inc/algorithm Outdated
Comment thread stl/inc/algorithm Outdated
Comment thread stl/inc/algorithm Outdated
Comment thread stl/inc/algorithm Outdated
... with `_STL_INTERNAL_STATIC_ASSERT` when we don't want to pay the throughput cost of constraints.
Comment thread stl/inc/xutility Outdated
Comment thread stl/inc/algorithm
Comment thread tests/std/tests/P0896R4_ranges_alg_search/test.cpp
@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit 3c13998 into microsoft:master Jun 24, 2020
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for implementing this algorithm! Onward to ranges::boyer_moore_search! 😹

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cxx20 C++20 feature ranges C++20/23 ranges

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants