diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-10-05 11:08:48 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-10-05 11:08:48 +0100 |
commit | 6dfe2c57007522013865d8a7755a35e6cb732d1d (patch) | |
tree | 8324b17d93b454e7dd4383d1286ee4044bb5d628 | |
parent | 513b6c6ab95cb36b5405de394f24b59f4f2b9a3d (diff) | |
download | rspamd-6dfe2c57007522013865d8a7755a35e6cb732d1d.tar.gz rspamd-6dfe2c57007522013865d8a7755a35e6cb732d1d.zip |
[Minor] Mark operators constexpr
-rw-r--r-- | src/libmime/mime_string.hxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libmime/mime_string.hxx b/src/libmime/mime_string.hxx index 890708de2..41d2f5f7e 100644 --- a/src/libmime/mime_string.hxx +++ b/src/libmime/mime_string.hxx @@ -52,19 +52,19 @@ enum class mime_string_flags : std::uint8_t { MIME_STRING_SEEN_INVALID = 0x1 << 1, }; -mime_string_flags operator |(mime_string_flags lhs, mime_string_flags rhs) +constexpr mime_string_flags operator |(mime_string_flags lhs, mime_string_flags rhs) { using ut = std::underlying_type<mime_string_flags>::type; return static_cast<mime_string_flags>(static_cast<ut>(lhs) | static_cast<ut>(rhs)); } -mime_string_flags operator &(mime_string_flags lhs, mime_string_flags rhs) +constexpr mime_string_flags operator &(mime_string_flags lhs, mime_string_flags rhs) { using ut = std::underlying_type<mime_string_flags>::type; return static_cast<mime_string_flags>(static_cast<ut>(lhs) & static_cast<ut>(rhs)); } -bool operator !(mime_string_flags fl) +constexpr bool operator !(mime_string_flags fl) { return fl == mime_string_flags::MIME_STRING_DEFAULT; } |