Skip to content

Commit 862521e

Browse files
Added function to clear dedicated bit.
Added `void clear(uint8_t idx)`
1 parent c70dadd commit 862521e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/BoolArray32.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ struct BoolArray32 {
1111
BoolArray32() : v(0) {}
1212

1313
inline void clear() { v = 0; }
14+
inline void clear(uint8_t idx) { v &= ~(1u << idx); }
1415
inline void set(uint8_t idx) { v |= (1u << idx); }
1516
inline bool get(uint8_t idx) const { return (v >> idx) & 1u; }
1617
};
1718

18-
#endif // BOOL_ARRAY32_H
19+
#endif // BOOL_ARRAY32_H

0 commit comments

Comments
 (0)