summaryrefslogtreecommitdiff
path: root/src/coord.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-03-11 13:59:25 +0000
committerMaxime Coste <frrrwww@gmail.com>2015-03-11 13:59:25 +0000
commita0e8e4265ad3ad42d6b616538477421b881f7f59 (patch)
tree59ee0b4f973b800adfc26ad613bdb2d5b0cd9cfd /src/coord.hh
parent023c8afb73c28755e9aa426418aeab163775ad89 (diff)
coords/units hashing refactoring
Diffstat (limited to 'src/coord.hh')
-rw-r--r--src/coord.hh15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/coord.hh b/src/coord.hh
index aae08ba9..252496d1 100644
--- a/src/coord.hh
+++ b/src/coord.hh
@@ -84,6 +84,11 @@ struct LineAndColumn
{
return line != other.line or column != other.column;
}
+
+ friend size_t hash_value(const EffectiveType& val)
+ {
+ return hash_values(val.line, val.column);
+ }
};
struct ByteCoord : LineAndColumn<ByteCoord, LineCount, ByteCount>
@@ -93,11 +98,6 @@ 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]]
@@ -105,11 +105,6 @@ 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]]