Modify

Opened 9 months ago

Closed 8 months ago

Last modified 6 months ago

#12459 closed Feature Requests (fixed)

Support polymorphic_allocator in boost::unordered_map/set

Reported by: skhoroshavin@… Owned by: danieljames
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 follow-up: Changed 9 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 9 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 9 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 8 months ago by danieljames

  • Resolution set to fixed
  • Status changed from new to closed

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

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

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain danieljames.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.