Modify

Opened 14 months ago

Closed 13 months ago

Last modified 11 months ago

#12459 closed Feature Requests (fixed)

Support polymorphic_allocator in boost::unordered_map/set

Reported by: skhoroshavin@… 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.

Attachments (0)

Change History (5)

comment:1 Changed 14 months ago by 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.

comment:2 in reply to:  1 Changed 14 months ago by skhoroshavin@…

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 Changed 14 months ago by anonymous

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 Changed 13 months ago by Daniel James

Resolution: fixed
Status: newclosed

comment:5 Changed 11 months ago by sergey.korytnik@…

The same problem with boost::multi_index class. It expects Allocator::rebind struct.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Daniel James.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.