I started using Boost ICL and I came across very simple things. For example, a function containsshould return true or false depending on whether this element is in the range or not. However, this works for [right,left]_open_intervals, but not for [open,closed]_inteval(see Example below).
This seems too obvious to be oversight. Am I using the library for the purpose?
For example (using gcc 4.8 or clang 3.3 and Boost 1.54):
#include <boost/concept_check.hpp> //needed to make this MWE work, boost icl should include it internally
#include<boost/icl/right_open_interval.hpp>
#include<boost/icl/closed_interval.hpp>
#include<boost/icl/open_interval.hpp>
int main(){
boost::icl::right_open_interval<double> roi(6.,7.);
assert(boost::icl::contains(roi, 6.) == true);
assert(boost::icl::contains(roi, 6.) == false);
boost::icl::closed_interval<double> oi(4.,5.);
assert(boost::icl::contains( oi, 4.) == false);
assert(boost::icl::contains( oi, 5.) == false);
}
Note. The above terms are called “static” intervals (because their related properties are part of the type). Dynamic intervals work as expected.