From aea4a73f134a68da740161f54a0189551245590e Mon Sep 17 00:00:00 2001 From: Armin Penz Date: Thu, 17 Sep 2026 10:58:05 +0200 Subject: [PATCH 1/2] feat: enum.hpp - add operator~ and operator&= --- CHANGELOG.md | 1 + include/mstd/enum.hpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44e6498..a384477 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. ### Enum - more clang-tidy fix for enum type +- add operator~ and operator&= ## Next Release diff --git a/include/mstd/enum.hpp b/include/mstd/enum.hpp index 9c2dbc2..dabceed 100644 --- a/include/mstd/enum.hpp +++ b/include/mstd/enum.hpp @@ -134,12 +134,18 @@ static_cast(lhs) | static_cast(rhs) \ ); \ } \ + \ inline constexpr EnumName& operator|=(EnumName& lhs, EnumName rhs) \ { \ lhs = lhs | rhs; \ return lhs; \ } \ \ + inline constexpr EnumName operator~(EnumName value) \ + { \ + return static_cast(~static_cast(value)); \ + } \ + \ struct EnumName##FlagTest \ { \ Underlying value; \ @@ -161,6 +167,12 @@ )}; \ } \ \ + inline constexpr EnumName& operator&=(EnumName& lhs, EnumName rhs) \ + { \ + lhs = lhs & rhs; \ + return lhs; \ + } \ + \ inline constexpr bool operator!(EnumName lhs) \ { \ return !static_cast(lhs); \ From a26ea5f7b93b070a7eb116d7a46db0d94abbf2c1 Mon Sep 17 00:00:00 2001 From: Armin Penz Date: Fri, 18 Sep 2026 07:12:29 +0200 Subject: [PATCH 2/2] fix: Changelog.md by moving "Next Release" back on top --- CHANGELOG.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a384477..0c376c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,16 +2,19 @@ All notable changes to this project will be documented in this file. +## Next Release + ### Enum -- more clang-tidy fix for enum type - add operator~ and operator&= -## Next Release - ## [0.2.4](https://github.com/repo/owner/releases/tag/0.2.4) - 2026-09-16 +### Enum + +- more clang-tidy fix for enum type + ## [0.2.3](https://github.com/repo/owner/releases/tag/0.2.3) - 2026-08-26 ### Types