I started to use Boost ICL and I stumbled upon very basic stuff. For example the function contains
should return true or false depending if a given element is in the interval or not. However that works for [right,left]_open_intervals
but not for [open,closed]_inteval
(see example below).
This seems to be too obvious to be an oversight. I am using the library in the intended way?
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); //ok assert(boost::icl::contains(roi, 6.) == false); //ok boost::icl::closed_interval<double> oi(4.,5.); // or open_interval assert(boost::icl::contains( oi, 4.) == false); //error: "candidate template ignored" assert(boost::icl::contains( oi, 5.) == false); //error: "candidate template ignored" }
Note: The above are called "static" intervals (because their bound properties are part of the type). Dynamic intervals work as expected.