Modify

Ticket #12459 (closed Feature Requests: fixed)

Opened 6 months ago

Last modified 3 months ago

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

Change History

comment:1 follow-up: ↓ 2 Changed 6 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 6 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 6 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 5 months ago by danieljames

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

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

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

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
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.