Boost logo

Boost :

Subject: Re: [boost] Review Request: Boost.Itl; The Interval Template Library
From: Joachim Faulhaber (afojgo_at_[hidden])
Date: 2009-09-24 10:13:46


2009/9/24 Joachim Faulhaber <afojgo_at_[hidden]>:
> 2009/9/24 Gottlob Frege <gottlobfrege_at_[hidden]>:
>> As an example usage, with your library, how would you write a 'for a
>> given interval_set, is this time-range [a, b) empty' function?
>>
> I am not sure if I understand exactly what you mean here ... but
>
> // This code checks if an interval_set is empty within a range.
> interval_set<time> some_times;
> some_times += ...; time a = ..., b = ...;
> if(intersects(some_times, interval<int>::rightopen(a,b)))
>    ; // Within the range [a,b) some_times is not empty
>

Correction: must be interval<time> of course

// This code checks if an interval_set is empty within a range.
interval_set<time> some_times;
some_times += ...; time a = ..., b = ...;
if(intersects(some_times, interval<time>::rightopen(a,b)))
   ; // Within the range [a,b) some_times is not empty


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk