Modify

Ticket #11820 (closed Bugs: fixed)

Opened 16 months ago

Last modified 8 months ago

compilier error when using operator[] of map

Reported by: anonymous Owned by: igaztanaga
Milestone: To Be Determined Component: container
Version: Boost 1.59.0 Severity: Problem
Keywords: Cc:

Description

  1. I've define a map with specific Allocator, map<key, value, less, MyAllocator?>
  2. if I call operator[] of this map, it will not find the right allocator

mapped_type& priv_subscript(BOOST_RV_REF(key_type) mk)

{

key_type &k = mk; we can optimize this iterator i = this->lower_bound(k); i->first is greater than or equivalent to k.

if (i == this->end()
this->key_comp()(k, (*i).first)){

container_detail::value_init<mapped_type> m; movable_value_type val(boost::move(k), boost::move(m.m_t)); i = insert(i, boost::move(val));

} return (*i).second;

}

  1. because of this code " movable_value_type val(boost::move(k), boost::move(m.m_t)); "

it will not new the right pair with right allocator when using operator[]

Attachments

Change History

comment:1 Changed 16 months ago by viboes

  • Owner set to igaztanaga
  • Component changed from None to container

comment:2 Changed 15 months ago by igaztanaga

Thanks for the report. Can you check the following commit fixes your problem?

 https://github.com/boostorg/container/commit/a3262c0ae75280f59ae7e9baa960e6873a5ae57f

comment:3 Changed 8 months ago by igaztanaga

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

Closed bug as no confirmation was obtained by the reporter.

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.