Go to the source code of this file.
template<typename Range >
bool rangesIntersect |
( |
const Range & |
a, |
|
|
const Range & |
b |
|
) |
| |
|
inline |
Utility for checking efficiently if two one-dimantional intervals intersect. Precondition: the intervals are not empty, i.e. for i in a,b i.first <= i.second. The Range template argument is expected to have the std::pair interface, i.e. for Range instance r r.first is the beginning of the interval and r.second is the end of the interval.
Definition at line 14 of file rangesIntersect.h.
15 return !(
a.first >
b.second ||
b.first >
a.second);
template<typename Range , typename Less >
bool rangesIntersect |
( |
const Range & |
a, |
|
|
const Range & |
b, |
|
|
Less const & |
less |
|
) |
| |
|
inline |
template<typename Range , typename T >
bool rangesIntersect |
( |
const Range & |
a, |
|
|
const Range & |
b, |
|
|
bool(*)(T, T) |
less |
|
) |
| |
|
inline |