summaryrefslogtreecommitdiff
path: root/src/units.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-10-17 22:45:17 +0800
committerMaxime Coste <mawww@kakoune.org>2017-10-20 12:21:22 +0800
commitd486ea84e57bdabec07fe38a0bb4fb5bdf21848f (patch)
tree619966c9d6f0a58b329f646be6926b45b72e5fb1 /src/units.hh
parentddff35e5ab6a9bed29c49547eaee91637854f029 (diff)
Constexprify various hash functions
Diffstat (limited to 'src/units.hh')
-rw-r--r--src/units.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/units.hh b/src/units.hh
index 0218055f..1c10c3af 100644
--- a/src/units.hh
+++ b/src/units.hh
@@ -115,8 +115,8 @@ public:
[[gnu::always_inline]]
explicit constexpr operator bool() const { return m_value; }
- friend size_t hash_value(RealType val) { return hash_value(val.m_value); }
- friend size_t abs(RealType val) { return val.m_value < ValueType(0) ? -val.m_value : val.m_value; }
+ friend constexpr size_t hash_value(RealType val) { return hash_value(val.m_value); }
+ friend constexpr size_t abs(RealType val) { return val.m_value < ValueType(0) ? -val.m_value : val.m_value; }
explicit operator size_t() { kak_assert(m_value >= 0); return (size_t)m_value; }