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

P0919R3 Heterogeneous lookup for unordered containers #2479

Merged
merged 3 commits into from Nov 26, 2018

Conversation

burblebee
Copy link
Contributor

Fixes #2433.

@jensmaurer jensmaurer changed the title Motions 2018 11 lwg 27 P0919R3 Heterogeneous lookup for unordered containers Nov 16, 2018
@jensmaurer jensmaurer added this to the post-2018-11 milestone Nov 16, 2018
source/containers.tex Outdated Show resolved Hide resolved
@burblebee burblebee added the changes requested Changes to the wording or approach have been requested and not yet applied. label Nov 23, 2018
@cpplearner
Copy link
Contributor

The following uses of Pred should probably be changed to use key_equal (or "key equality predicate").

container. The container's object of type \tcode{Pred} ---

draft/source/containers.tex

Lines 2351 to 2353 in c1140dc

& \requires\ \tcode{Pred} is \oldconcept{CopyConstructible}.\br
\tcode{Pred} shall be a binary predicate that takes two arguments
of type \tcode{Key}. \tcode{Pred} is an equivalence relation.%

unless the \tcode{Pred} function object has

of the partition into equivalent-key groups produced by \tcode{Pred}.

\tcode{Pred} object (if any).

\tcode{Hash} or \tcode{Pred} object (if any).

is_nothrow_move_assignable_v<Pred>);

is_nothrow_swappable_v<Pred>);

is_nothrow_move_assignable_v<Pred>);

is_nothrow_swappable_v<Pred>);

is_nothrow_move_assignable_v<Pred>);

is_nothrow_swappable_v<Pred>);

is_nothrow_move_assignable_v<Pred>);

is_nothrow_swappable_v<Pred>);

@zygoloid
Copy link
Member

@cpplearner I think you might be right, but it's not clear to me that that's an editorial change. In particular, the behavior of unordered containers with a hasher that has a transparent_key_equal and whose Pred is equal_to<Key> (which is the only possibility where it can be different from the transparent_key_equal type) seems highly underspecified to me. (Is the specified Pred entirely ignored, or sometimes still used? What happens if operator== is inconsistent with the "transparent" key equality functor? How does eg unordered_set<std::string, hash_by_lowercased_contents> behave?)

Can you ask to get a library issue opened to replace Pred with key_equal in all the relevant places?

@zygoloid zygoloid merged commit d6700cc into master Nov 26, 2018
@jensmaurer jensmaurer deleted the motions-2018-11-lwg-27 branch October 19, 2019 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes requested Changes to the wording or approach have been requested and not yet applied.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants