overlaps takes Range parameters instead of Selection

This commit is contained in:
Maxime Coste 2012-12-11 14:11:33 +01:00
parent 5669d576fc
commit 892b65b355

View File

@ -31,6 +31,12 @@ private:
BufferIterator m_last;
};
inline bool overlaps(const Range& lhs, const Range& rhs)
{
return (lhs.first() <= rhs.first() and lhs.last() >= rhs.first()) or
(lhs.first() <= rhs.last() and lhs.last() >= rhs.last());
}
using CaptureList = std::vector<String>;
// A selection is a Range, associated with a CaptureList
@ -66,12 +72,6 @@ private:
};
using SelectionList = std::vector<Selection>;
inline bool overlaps(const Selection& lhs, const Selection& rhs)
{
return (lhs.first() <= rhs.first() and lhs.last() >= rhs.first()) or
(lhs.first() <= rhs.last() and lhs.last() >= rhs.last());
}
}
#endif // selection_hh_INCLUDED