Opened 8 years ago
Closed 7 years ago
#9987 closed Bugs (fixed)
boost icl throws on gaps
Reported by: | Owned by: | Joachim Faulhaber | |
---|---|---|---|
Milestone: | To Be Determined | Component: | ICL |
Version: | Boost 1.55.0 | Severity: | Showstopper |
Keywords: | Cc: | tvk.boost@… |
Description
void overlap_counter()
{
typedef interval_map<int, int> OverlapCounterT; OverlapCounterT overlap_counter; discrete_interval<int> inter_val;
int l[10]={1,1,1}; int r[10]={2,3,3}; for(int i = 0; i < 3; i++){
inter_val = discrete_interval<int>::right_open(l[i],r[i]); overlap_counter += make_pair(inter_val, 1);
} get_insert prints: *[2,3) *[2,4)
Exceptions raised here.
Assertion failed: (this->_map.find(inter_val) == this->_map.end()), function gap_insert, file /Users/gagaga/boost155/include/boost/icl/interval_base_map.hpp, line 555.
}
Change History (4)
comment:1 by , 8 years ago
comment:3 by , 8 years ago
In fact, this seems to be a duplicate of Bug 9501. See my comment there for an easy fix (add #define ICL_USE_BOOST_MOVE_IMPLEMENTATION before including ICL headers).
I just encountered the same error in my own code when using interval_map and found this bug report.
I can also reproduce the issue with the code posted above. I agree, this is indeed a showstopper.
A temporary workaround seems to be to do .erase(inter_val) first, and then the .add() or += operation.