Open afluriach opened 5 years ago
That is not a bug. See https://www.boost.org/doc/libs/1_71_0/libs/icl/doc/html/boost_icl/concepts/map_traits.html
- A identity absorber never stores value pairs (k,0) that carry identity elements.
- A identity enricher stores value pairs (k,0).
Maps created with partial_absorber
(default) or total_absorber
trait will not store neutral/identity/default values.
If you want your map to include 0
value, then you should create your map with:
boost::icl::interval_map<float, int, partial_enricher> m;
When inserting an entry into a
boost::icl::interval_map<float, int>
, the entry is not inserted if the value is 0. I am guessing this is a bug that happens when the value evaluates to a boolean false. note: using VS2017, C++14. Issue is present in 1.59 - 1.69 (including C++17 for 1.69)In the same code, the interval_map has one fewer element than it should, with the interval corresponding to value 0 missing, Changing it to use a ones-based index works as a workaround. And if I remove the post-increment and try to assign every interval the value zero, none of them get added.