[util] Add util::bitset::set(i, val)
Allow for easier callsite code instead of having to switch calling set(i) vs clear(i) - now set(i, boolean) is an option.
This commit is contained in:
@@ -51,6 +51,14 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
__attribute__ ((always_inline))
|
||||||
|
inline bitset & set(T i, bool value) {
|
||||||
|
if (value) set(i);
|
||||||
|
else clear(i);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
__attribute__ ((always_inline))
|
__attribute__ ((always_inline))
|
||||||
inline bitset & clear(T i) {
|
inline bitset & clear(T i) {
|
||||||
|
|||||||
Reference in New Issue
Block a user