2018-10-21 03:10:21 +02:00
|
|
|
#ifndef range_hh_INCLUDED
|
|
|
|
#define range_hh_INCLUDED
|
|
|
|
|
|
|
|
namespace Kakoune
|
|
|
|
{
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
struct Range
|
|
|
|
{
|
|
|
|
T begin;
|
|
|
|
T end;
|
|
|
|
|
|
|
|
friend bool operator==(const Range& lhs, const Range& rhs)
|
|
|
|
{
|
|
|
|
return lhs.begin == rhs.begin and lhs.end == rhs.end;
|
|
|
|
}
|
|
|
|
|
|
|
|
friend bool operator!=(const Range& lhs, const Range& rhs)
|
|
|
|
{
|
|
|
|
return not (lhs == rhs);
|
|
|
|
}
|
|
|
|
|
|
|
|
friend size_t hash_value(const Range& range)
|
|
|
|
{
|
|
|
|
return hash_values(range.begin, range.end);
|
|
|
|
}
|
2020-06-27 05:33:50 +02:00
|
|
|
|
|
|
|
bool empty() const { return begin == end; }
|
2018-10-21 03:10:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // range_hh_INCLUDED
|