Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

All notable changes to this project will be documented in this file.

### Enum
## Next Release

- more clang-tidy fix for enum type
### Enum

## Next Release
- add operator~ and operator&=
Comment thread
ape33 marked this conversation as resolved.

<!-- insertion marker -->
## [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
Expand Down
12 changes: 12 additions & 0 deletions include/mstd/enum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,18 @@
static_cast<Underlying>(lhs) | static_cast<Underlying>(rhs) \
); \
} \
\
inline constexpr EnumName& operator|=(EnumName& lhs, EnumName rhs) \
{ \
lhs = lhs | rhs; \
return lhs; \
} \
\
inline constexpr EnumName operator~(EnumName value) \
{ \
return static_cast<EnumName>(~static_cast<Underlying>(value)); \
} \
\
struct EnumName##FlagTest \
{ \
Underlying value; \
Expand All @@ -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<Underlying>(lhs); \
Expand Down
Loading