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

Fixed support for allocators with explicit copy constructors #234

Merged
merged 6 commits into from Feb 17, 2024

Conversation

joaquintides
Copy link
Member

@joaquintides joaquintides commented Feb 17, 2024

Fixes #204

@cppalliance-bot
Copy link

An automated preview of the documentation is available at https://234.unordered.prtest2.cppalliance.org/libs/unordered/doc/html/unordered.html

@pdimov
Copy link
Member

pdimov commented Feb 17, 2024

Interesting. Are such allocators conforming? The latest allocator requirement table seems to say so; was it always such, or is this a recent change?

@pdimov
Copy link
Member

pdimov commented Feb 17, 2024

(Apart from those philosophical questions, I don't see anything wrong with the change.)

@joaquintides
Copy link
Member Author

joaquintides commented Feb 17, 2024

Interesting. Are such allocators conforming? The latest allocator requirement table seems to say so; was it always such, or is this a recent change?

I don't know for sure. If you refer to the A a(b) clause, with b being a rebound type from A, this seems to have been that way since ever; I couldn't find anything else explicitly allowing implicit convertibility.

@pdimov
Copy link
Member

pdimov commented Feb 17, 2024

Seems intentional because the same type entries explicitly mandate A a2 = a; to also work.

@pdimov
Copy link
Member

pdimov commented Feb 17, 2024

Looks like C++03 only had the X a(b); requirement, C++11 added the X a1(a); requirement, and C++14 added X a1 = a;.

This seems a bit accidental to me.

@joaquintides
Copy link
Member Author

joaquintides commented Feb 17, 2024

This seems a bit accidental to me.

Probably. If I recall correctly, though, Chris commented this issue actually hit a real user, so it doesn't hurt to have it fixed.

@pdimov
Copy link
Member

pdimov commented Feb 17, 2024

Yeah, I know, I was just wondering whether such allocators are allowed.

@joaquintides joaquintides merged commit 15cfef6 into develop Feb 17, 2024
93 of 94 checks passed
@joaquintides joaquintides deleted the fix/explicit-alloc-ctor branch February 17, 2024 17:58
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.

Unordered doesn't respect explicit converting Allocator constructors
3 participants