libtime++: Date and time calculation

◆ largestcommon()

TRange libtime::TRange::largestcommon ( const TRange range) const

find largest range spanned by both

Definition at line 68 of file ranges.cc.

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

69  {
70  libtime_assert((this->overlaps(range)),
71  "ERROR (Trange::largestcommon): ranges must overlap");
72  return(TRange(Mbegin<range.begin() ? Mbegin : range.begin(),
73  Mend>range.end() ? Mend : range.end()));
74  }
#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: