Skip to content

Commit 2d24bcf

Browse files
committed
Overload |= and &= for hat::scan_hint
1 parent ea035cd commit 2d24bcf

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

include/libhat/scanner.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@ LIBHAT_EXPORT namespace hat {
116116
using U = std::underlying_type_t<scan_hint>;
117117
return static_cast<scan_hint>(static_cast<U>(lhs) & static_cast<U>(rhs));
118118
}
119+
120+
constexpr scan_hint& operator|=(scan_hint& lhs, const scan_hint rhs) {
121+
lhs = lhs | rhs;
122+
return lhs;
123+
}
124+
125+
constexpr scan_hint& operator&=(scan_hint& lhs, const scan_hint rhs) {
126+
lhs = lhs & rhs;
127+
return lhs;
128+
}
119129
}
120130

121131
namespace hat::detail {

0 commit comments

Comments
 (0)