|
Boost Users : |
Subject: Re: [Boost-users] A few ICL questions.
From: Joachim Faulhaber (afojgo_at_[hidden])
Date: 2015-11-19 03:48:45
>> The third question is about a runtime error I'm getting in the above
>> code. The comment in *main *shows the scenario. Basically if I use *0xffff
>> *as the end of the first range I get an ASSERT at runtime whereas 0xfffe
>> works fine.
>>
>
> You can use icl interval containers with limited integral numeric
> domain-types safely on intervals using values from ++std::min<T>() to
> --std::max<T>(): Two values less. So if you want to manage a domain of
> values like in your example, you'd need to use a larger value type. It is
> possible to make the code handle those corner cases correctly (yet not
> trivial, since it is generic code). For achieving that the most frequently
> called functions would all need to make additional checks making the code
> ugly and more slowly. And yes, this information should be added to the
> documentation.
>
>
Ok this assessment was premature ... and thank you for your patch. It fixes
the problem and I have already pushed the changes. For other interval types
and their corner cases I will write a few tests shortly.
-- Interval Container Library [Boost.Icl] http://www.joachim-faulhaber.de
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net