mirror of
https://github.com/justinian/jsix.git
synced 2025-12-09 16:04:32 -08:00
[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;
|
||||
}
|
||||
|
||||
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>
|
||||
__attribute__ ((always_inline))
|
||||
inline bitset & clear(T i) {
|
||||
|
||||
Reference in New Issue
Block a user