Implement rebind, the rebinding constructor, and rebind-compatible comparison operators.
Details
- Reviewers
• Quuxplusone - Group Reviewers
Restricted Project - Commits
- rGc5ba46ea1804: [libcxx][test] MaybePOCCAAllocator should meet the Cpp17Allocator requirements
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM as long as the answers to all my questions are "no, what I have written here is correct." ;)
libcxx/test/support/allocators.h | ||
---|---|---|
199–202 | Isn't there allocator_traits magic that does this for all templates automatically? or is that only in pointer_traits? | |
210 | If CI is happy with this, then OK, but I suspect that whatever is happening with copy_assigned_into_ is not well-thought-out and works only by accident, wherever it's being used/tested. | |
233–235 | I kneejerk want to leave this operator== alone and rely on the implicit converting ctor you just added... but would that make allocT == allocU ambiguous because the compiler doesn't know which operand to convert? |
libcxx/test/support/allocators.h | ||
---|---|---|
199–202 | The magic only works when the allocator is a specialization of a template with at least one type parameter and no non-type template parameters. ([allocator.traits.types]/11) | |
210 | I think I just had the constructor copy what the == examines for head-in-the-sand conformance, but I suspect the result is tests that always pass. I'll investigate. | |
212 | Unnecessary empty line. | |
233–235 | I think that would be ambiguous, but I don't claim to be able to reason about operator rewrites in the presence of implicit conversions. I'll investigate. |
Isn't there allocator_traits magic that does this for all templates automatically? or is that only in pointer_traits?