From 0e29c98b9f6791f174cfdca4e9b6d3d8174c625d Mon Sep 17 00:00:00 2001 From: Martchus Date: Thu, 13 May 2021 15:28:56 +0200 Subject: [PATCH] Use flagenumclass.h to implement operators for VorbisCommentFlags --- vorbis/vorbiscommentfield.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/vorbis/vorbiscommentfield.h b/vorbis/vorbiscommentfield.h index 1ca84f5..bdab537 100644 --- a/vorbis/vorbiscommentfield.h +++ b/vorbis/vorbiscommentfield.h @@ -3,6 +3,8 @@ #include "../generictagfield.h" +#include + namespace CppUtilities { class BinaryReader; class BinaryWriter; @@ -20,15 +22,11 @@ enum class VorbisCommentFlags : std::uint8_t { NoCovers = 0x4 /**< Skips all covers when making. */ }; -constexpr bool operator&(VorbisCommentFlags lhs, VorbisCommentFlags rhs) -{ - return static_cast(lhs) & static_cast(rhs); -} +} // namespace TagParser -constexpr VorbisCommentFlags operator|(VorbisCommentFlags lhs, VorbisCommentFlags rhs) -{ - return static_cast(static_cast(lhs) | static_cast(rhs)); -} +CPP_UTILITIES_MARK_FLAG_ENUM_CLASS(TagParser, TagParser::VorbisCommentFlags) + +namespace TagParser { class VorbisCommentField; class Diagnostics;