commit 6dfe2c5: [Minor] Mark operators constexpr
Vsevolod Stakhov
vsevolod at highsecure.ru
Tue Oct 5 11:14:08 UTC 2021
Author: Vsevolod Stakhov
Date: 2021-10-05 11:08:48 +0100
URL: https://github.com/rspamd/rspamd/commit/6dfe2c57007522013865d8a7755a35e6cb732d1d
[Minor] Mark operators constexpr
---
src/libmime/mime_string.hxx | 6 +++---
1 file 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;
}
More information about the Commits
mailing list