You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int main()
{
icl::interval_set<uint8_t> i8;
i8.insert(std::numeric_limits<uint8_t>::max());
fmt::print("cardinality={}", cardinality(i8));
}
this prints cardinality=18446744073709551361 .
The issue is the cardinality() at concept/interval.hpp which uses last_next(object) which overflows to 0, in this case.
With interval_set, things would be worse, since these overflows would be undefined behavior.
I suggest removing the use of last_next in any situation where the interval may be the biggest interval in the set.
The text was updated successfully, but these errors were encountered:
Consider https://godbolt.org/z/5xKWK9G5o
namespace icl = boost::icl;
this prints
cardinality=18446744073709551361
.The issue is the cardinality() at concept/interval.hpp which uses
last_next(object)
which overflows to 0, in this case.With interval_set, things would be worse, since these overflows would be undefined behavior.
I suggest removing the use of
last_next
in any situation where the interval may be the biggest interval in the set.The text was updated successfully, but these errors were encountered: