1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-28 06:08:05 +03:00

Orderable Keys

This commit is contained in:
Maxime Coste 2015-03-07 15:29:21 +00:00
parent 4be6090107
commit 3ece7bcf75

View File

@ -57,11 +57,11 @@ struct Key
constexpr Key(Codepoint key)
: modifiers(Modifiers::None), key(key) {}
constexpr bool operator==(Key other) const
{ return modifiers == other.modifiers and key == other.key; }
constexpr uint64_t val() const { return (uint64_t)modifiers << 32 | key; }
constexpr bool operator!=(Key other) const
{ return modifiers != other.modifiers or key != other.key; }
constexpr bool operator==(Key other) const { return val() == other.val(); }
constexpr bool operator!=(Key other) const { return val() != other.val(); }
constexpr bool operator<(Key other) const { return val() < other.val(); }
};
template<> struct WithBitOps<Key::Modifiers> : std::true_type {};