Skip to content

Conversation

@CaseyCarter
Copy link
Contributor

@CaseyCarter CaseyCarter commented Jun 11, 2020

Includes implementation of concepts indirect_equivalence_relation and indirect_strict_weak_order, and new <xutility> helper _Find_last_iterator(first, last, count) which - given [first, last) of length count - returns the iterator that corresponds to last.

Drive-by:

  • Move std::is_permutation from <xutility> into <algorithm>, leaving behind the _Check_match_counts helper which is used elsewhere in the STL.
  • Allow clang-format to handle the algorithm result types since they now have no requires-clauses.

Partially addresses #39.

Includes implementation of concepts `indirect_equivalence_relation` and `indirect_strict_weak_order`, and new `<xutility>` helper `_Find_last_iterator(first, last, count)` which - given `[first, last)` of length `count` - returns the iterator that corresponds to `last`.

Drive-by:
* Move `std::is_permutation` from `<xutility>` into `<algorithm>`, leaving behind the `_Check_match_counts` helper which is used elsewhere in the STL.
* Allow clang-format to handle the algorithm result types since they now have no requires-clauses.
@CaseyCarter CaseyCarter added the cxx20 C++20 feature label Jun 11, 2020
@CaseyCarter CaseyCarter requested a review from a team as a code owner June 11, 2020 23:23
Copy link
Contributor

@miscco miscco left a comment

Choose a reason for hiding this comment

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

Whenever i see is_permutation i cringe about the cost involved. That said the code is great!

libc++ `unordered_meow` tests were assuming that `#include <unordered_meow>` makes `std::is_permutation` available.

Drive-by: Inline 4-argument `_Is_permutation_unchecked` into `is_permutation` since this `_unchecked` overload isn't used elsewhere.
@CaseyCarter CaseyCarter mentioned this pull request Jun 13, 2020
Copy link
Contributor

@mnatsuhara mnatsuhara left a comment

Choose a reason for hiding this comment

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

I haven't looked at the is_permutation algorithm before -- nifty 😄

Copy link
Contributor

@mnatsuhara mnatsuhara left a comment

Choose a reason for hiding this comment

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

New test coverage looks great!

CaseyCarter and others added 5 commits June 18, 2020 16:57
Co-authored-by: mnatsuhara <46756417+mnatsuhara@users.noreply.github.com>
... with `_STL_INTERNAL_STATIC_ASSERT` when we don't want to pay the throughput cost of constraints.
@StephanTLavavej StephanTLavavej self-assigned this Jun 23, 2020
@StephanTLavavej StephanTLavavej merged commit 70d23a1 into microsoft:master Jun 24, 2020
@StephanTLavavej
Copy link
Member

!ahknsT😸

@CaseyCarter CaseyCarter deleted the is_perm branch June 24, 2020 13:30
ahanamuk pushed a commit to ahanamuk/STL that referenced this pull request Jul 1, 2020
Co-authored-by: mnatsuhara <46756417+mnatsuhara@users.noreply.github.com>
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
@StephanTLavavej StephanTLavavej added the ranges C++20/23 ranges label Jul 22, 2020
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