mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-06 18:01:01 -04:00
JSUOutputStream Matching for shield (#2825)
* JSUOutputStream Matching for shield * Fix nonmatching in JAUSectionHeap
This commit is contained in:
@@ -29,7 +29,7 @@ public:
|
||||
__bitset_base() { data = 0; }
|
||||
|
||||
bool test(size_t pos) const { return data & (1 << pos); }
|
||||
bool any() const;
|
||||
bool any() const { return data != 0; }
|
||||
void set(size_t pos, bool val) { data |= (1 << pos); }
|
||||
void reset(size_t pos) { data &= ~(1 << pos); }
|
||||
private:
|
||||
@@ -62,6 +62,15 @@ template<size_t N> void __bitset_base<N>::reset(size_t pos) {
|
||||
data[i] &= ~mask;
|
||||
}
|
||||
|
||||
template<size_t N> bool __bitset_base<N>::any() const {
|
||||
for (int i = 0; i < N; i++) {
|
||||
if (data[i] != 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template<size_t N> class bitset : private __bitset_base<(N - 1) / (sizeof(size_t) * 8) + 1> {
|
||||
public:
|
||||
typedef __bitset_base<(N - 1) / (sizeof(size_t) * 8) + 1> base;
|
||||
@@ -86,7 +95,9 @@ public:
|
||||
}
|
||||
return base::test(pos);
|
||||
}
|
||||
bool any() const;
|
||||
bool any() const {
|
||||
return base::any();
|
||||
}
|
||||
};
|
||||
} // namespace std
|
||||
|
||||
|
||||
Reference in New Issue
Block a user