diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-10-21 12:10:21 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2018-10-21 12:10:21 +1100 |
| commit | 72bdd7900f5366ff9e99e78baf9c3bd32e0d51e8 (patch) | |
| tree | bb69176c4846d007d0b94075e92bc541a5592588 /src/range.hh | |
| parent | 7dbca46bf021583df8edfa20451a8121ca78293e (diff) | |
Move LineRangeSet to line_modification.hh
Diffstat (limited to 'src/range.hh')
| -rw-r--r-- | src/range.hh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/range.hh b/src/range.hh new file mode 100644 index 00000000..eb8be269 --- /dev/null +++ b/src/range.hh @@ -0,0 +1,31 @@ +#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); + } +}; + +} + +#endif // range_hh_INCLUDED |
