From 809fe3e83e6666b19390d36f5245351dc52d1e5a Mon Sep 17 00:00:00 2001 From: Peter Buchegger Date: Fri, 13 Sep 2024 17:54:45 +0200 Subject: [PATCH] Update MessageType.h --- src/MessageType.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/MessageType.h b/src/MessageType.h index 935d3c8..6e34c3a 100644 --- a/src/MessageType.h +++ b/src/MessageType.h @@ -6,8 +6,7 @@ namespace aprs { class MessageType { public: - enum Value : uint8_t - { + enum Value : uint8_t { PositionWithoutTimestamp, // = and ! // PositionWithTimestamp, // @ and / // Status, // > @@ -56,12 +55,15 @@ class MessageType { // cppcheck-suppress noExplicitConstructor constexpr MessageType(Value aType) : _value(aType) { } + constexpr bool operator==(MessageType a) const { return _value == a._value; } + constexpr bool operator!=(MessageType a) const { return _value != a._value; } + explicit operator bool() const { return _value != Error; }