#12459 closed Feature Requests (fixed)
Support polymorphic_allocator in boost::unordered_map/set
Reported by: | Owned by: | Daniel James | |
---|---|---|---|
Milestone: | To Be Determined | Component: | unordered |
Version: | Boost 1.62.0 | Severity: | Problem |
Keywords: | Cc: | skhoroshavin@… |
Description
Right now boost::unordered_map/set require rebind struct in allocator, which is absent in polymorphic_allocator. This makes it impossible to use polymorphic_allocator "as is" in unordered containers.
Change History (5)
follow-up: 2 comment:1 by , 6 years ago
comment:2 by , 6 years ago
Replying to anonymous:
For now, you might be able to get it work by defining BOOST_UNORDERED_USE_ALLOCATOR_TRAITS to 1. That will tell it to use std::allocator_traits.
Thanks for pointing, it solved the issue. However I think it would be much better if this was either documented or enabled by default for compilers supporting it.
comment:3 by , 6 years ago
The "for now" was to suggest that this is a temporary workaround. I can't do anything at the moment because we're at the end of a release cycle.
comment:4 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Should be fixed in master, in this merge:
https://github.com/boostorg/unordered/commit/8a0592a35d5987fd33b49f2c63838e82f4f63be6
comment:5 by , 6 years ago
The same problem with boost::multi_index class. It expects Allocator::rebind struct.
For now, you might be able to get it work by defining BOOST_UNORDERED_USE_ALLOCATOR_TRAITS to 1. That will tell it to use std::allocator_traits.