libtime++: Date and time calculation

◆ smallestcommon()

TRange libtime::TRange::smallestcommon ( const TRange range) const

find largest range common to both

Definition at line 77 of file ranges.cc.

References begin(), end(), libtime_assert, Mbegin, Mend, overlaps(), and TRange().

78  {
79  libtime_assert((this->overlaps(range)),
80  "ERROR (Trange::smallestcommon): ranges must overlap");
81  return(TRange(Mbegin>range.begin() ? Mbegin : range.begin(),
82  Mend<range.end() ? Mend : range.end()));
83  }
#define libtime_assert(C, M)
Check an assertion and report by throwing an exception.
Definition: libtime++.h:714
TAbsoluteTime Mend
Definition: libtime++.h:633
bool overlaps(const TRange &) const
true if other range overlaps this one
Definition: ranges.cc:62
TAbsoluteTime Mbegin
Definition: libtime++.h:632
Here is the call graph for this function: