boostorg / unordered

Boost.org unordered module
http://boost.org/libs/unordered
Boost Software License 1.0
62 stars 55 forks source link

Fixed support for allocators with `explicit` copy constructors #234

Closed joaquintides closed 6 months ago

joaquintides commented 6 months ago

Fixes #204

cppalliance-bot commented 6 months ago

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

pdimov commented 6 months ago

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 commented 6 months ago

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

joaquintides commented 6 months ago

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 commented 6 months ago

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

pdimov commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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