Opened 10 years ago

Closed 10 years ago

#7948 closed Bugs (fixed)

Hinted addition on a split_interval_map does more than normal addition.

Reported by: Marvin Sielenkemper <m.sielenkemper@…> Owned by: Joachim Faulhaber
Milestone: Boost 1.54.0 Component: ICL
Version: Boost 1.51.0 Severity: Problem
Keywords: Cc:

Description

When adding an entry into an empty split_interval_map via the non-hinted add, the value is placed in the container by copying it there, only one value is default constructed for the absorption check.

With hinted addition the new entry is first default created in the container, then the entering entry is added via inplace_plus.

I would expect both operations to involve the same operations on the entry added since the hint only concerns finding the right place, not the handling.

Attachments (1)

Tests.cpp (2.2 KB ) - added by Marvin Sielenkemper <m.sielenkemper@…> 10 years ago.
Two test cases illustrating the problem.

Download all attachments as: .zip

Change History (2)

by Marvin Sielenkemper <m.sielenkemper@…>, 10 years ago

Attachment: Tests.cpp added

Two test cases illustrating the problem.

comment:1 by Joachim Faulhaber, 10 years ago

Milestone: To Be DeterminedBoost 1.54.0
Resolution: fixed
Status: newclosed

Hi Marvin,

hmm, good observation. But it's not easy to improve. I reduced the number of default contstructions by making the data member in class template identity_element static. Apart from that, since the code is generic and correct and I don't have a substantial improvement, I will leave the code as it is.

If you can provide a patch that works with all tests, you may send in a patch. For now I will close the ticket.

Thanx, Joachim

Note: See TracTickets for help on using tickets.