Modify

Ticket #6536 (closed Bugs: fixed)

Opened 2 years ago

Last modified 20 months ago

All container constructors should have a variant taking an allocator as a final parameter

Reported by: Erik Jensen <Erik.Jensen@…> Owned by: igaztanaga
Milestone: To Be Determined Component: container
Version: Boost 1.49.0 Severity: Problem
Keywords: Cc:

Description

I am attempting to use the new allocator_traits functionality to facilitate a scoped_pointer work-alike. However, I am running into difficulties because there are a number of constructors that do not have a variant taking an allocator as a final parameter. For example, basic_string does not have a copy-constructor taking an allocator.

Thanks, Erik Jensen

Attachments

Change History

comment:1 follow-up: ↓ 2 Changed 2 years ago by igaztanaga

Sorry, the scoped allocator model is not implemented yet, let's see if I can find time to bring it in Boost 1.50. Thanks for the ticket.

comment:2 in reply to: ↑ 1 Changed 2 years ago by Erik Jensen <Erik.Jensen@…>

Replying to igaztanaga:

Sorry, the scoped allocator model is not implemented yet, let's see if I can find time to bring it in Boost 1.50. Thanks for the ticket.

I know the model itself is not supported, but the new C++11 constructors are useful for more than just that, and it seems like implementation should be pretty simple. For example,

basic_string(const basic_string& s, const allocator_type& a) 
   :  base_t(a)
{ this->priv_range_initialize(s.begin(), s.end()); }

or

vector(const vector &x, const allocator_type &a)
: base_t(a)
{
   this->assign( container_detail::to_raw_pointer(x.members_.m_start)
               , container_detail::to_raw_pointer(x.members_.m_start + x.members_.m_size));
}

Of course, there are probably more complications that I am overlooking.

Thanks again for you consideration.

comment:3 Changed 20 months ago by igaztanaga

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

Fixed in Boost 1.50

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.