reference& operator=(bool t) {
if (t)
- *WordRef |= 1 << BitPos;
+ *WordRef |= 1L << BitPos;
else
- *WordRef &= ~(1 << BitPos);
+ *WordRef &= ~(1L << BitPos);
return *this;
}
reference& operator=(const reference& rhs) {
if (*rhs.WordRef & (1 << rhs.BitPos))
- *WordRef |= 1 << BitPos;
+ *WordRef |= 1L << BitPos;
else
- *WordRef &= ~(1 << BitPos);
+ *WordRef &= ~(1L << BitPos);
return *this;
}
operator bool() const {
- return (*WordRef) & (1 << BitPos);
+ return (*WordRef) & (1L << BitPos);
}
};
}
BitVector &set(unsigned Idx) {
- Bits[Idx / BITS_PER_WORD] |= 1 << (Idx % BITS_PER_WORD);
+ Bits[Idx / BITS_PER_WORD] |= 1L << (Idx % BITS_PER_WORD);
return *this;
}
}
BitVector &reset(unsigned Idx) {
- Bits[Idx / BITS_PER_WORD] &= ~(1 << (Idx % BITS_PER_WORD));
+ Bits[Idx / BITS_PER_WORD] &= ~(1L << (Idx % BITS_PER_WORD));
return *this;
}
}
BitVector &flip(unsigned Idx) {
- Bits[Idx / BITS_PER_WORD] ^= 1 << (Idx % BITS_PER_WORD);
+ Bits[Idx / BITS_PER_WORD] ^= 1L << (Idx % BITS_PER_WORD);
return *this;
}
}
bool operator[](unsigned Idx) const {
- BitWord Mask = 1 << (Idx % BITS_PER_WORD);
+ BitWord Mask = 1L << (Idx % BITS_PER_WORD);
return (Bits[Idx / BITS_PER_WORD] & Mask) != 0;
}