Opened 10 years ago

Closed 6 years ago

#8175 closed Feature Requests (fixed)

Make boost::container::allocator_arg_t a typedef of std::allocator_arg_t when available

Reported by: Erik.Jensen@… Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: container
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc: Erik.Jensen@…

Description

Currently, boost::container::allocator_arg_t is always defined as a simple, empty struct. It would be nice if it were instead a typedef of std::allocator_arg_t when the latter is available. Right now, I have to have a separate constructor overloads for each type, with an #if guard around the std::allocator_arg_t overload. It would be much nicer if I could just use boost::container::allocator_arg_t, and have it be automatically usable with std::scoped_allocator if supported by the implementation.

Thanks.

Change History (1)

comment:1 by Ion Gaztañaga, 6 years ago

Resolution: fixed
Status: newclosed

Reviewing old bugs. Since commit (included in Boost 1.58):

https://github.com/boostorg/container/commit/7635eba375c2eda18307db78515cce0adc76c9c7

allocator_arg_t is a typedef of const std::allocator_arg_t, which allows forward declaration of the standard allocator without including the standard header, and interoperability with std types.

Thanks for the report and sorry for the long delay to implement and document the solution.

Note: See TracTickets for help on using tickets.