diff options
Diffstat (limited to 'src/coord.hh')
| -rw-r--r-- | src/coord.hh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/coord.hh b/src/coord.hh index dbae5001..ed9347a5 100644 --- a/src/coord.hh +++ b/src/coord.hh @@ -2,6 +2,7 @@ #define coord_hh_INCLUDED #include "units.hh" +#include "hash.hh" namespace Kakoune { @@ -92,6 +93,11 @@ struct ByteCoord : LineAndColumn<ByteCoord, LineCount, ByteCount> : LineAndColumn(line, column) {} }; +inline size_t hash_value(const ByteCoord& val) +{ + return hash_values(val.line, val.column); +} + struct CharCoord : LineAndColumn<CharCoord, LineCount, CharCount> { [[gnu::always_inline]] @@ -99,6 +105,11 @@ struct CharCoord : LineAndColumn<CharCoord, LineCount, CharCount> : LineAndColumn(line, column) {} }; +inline size_t hash_value(const CharCoord& val) +{ + return hash_values(val.line, val.column); +} + struct ByteCoordAndTarget : ByteCoord { [[gnu::always_inline]] @@ -112,6 +123,11 @@ struct ByteCoordAndTarget : ByteCoord CharCount target; }; +inline size_t hash_value(const ByteCoordAndTarget& val) +{ + return hash_values(val.line, val.column, val.target); +} + } #endif // coord_hh_INCLUDED |
