reference& operator=(bool t) {
if (t)
- *WordRef |= 1L << BitPos;
+ *WordRef |= BitWord(1) << BitPos;
else
- *WordRef &= ~(1L << BitPos);
+ *WordRef &= ~(BitWord(1) << BitPos);
return *this;
}
operator bool() const {
- return ((*WordRef) & (1L << BitPos)) ? true : false;
+ return ((*WordRef) & (BitWord(1) << BitPos)) ? true : false;
}
};
}
BitVector &set(unsigned Idx) {
- Bits[Idx / BITWORD_SIZE] |= 1L << (Idx % BITWORD_SIZE);
+ Bits[Idx / BITWORD_SIZE] |= BitWord(1) << (Idx % BITWORD_SIZE);
return *this;
}
}
BitVector &reset(unsigned Idx) {
- Bits[Idx / BITWORD_SIZE] &= ~(1L << (Idx % BITWORD_SIZE));
+ Bits[Idx / BITWORD_SIZE] &= ~(BitWord(1) << (Idx % BITWORD_SIZE));
return *this;
}
}
BitVector &flip(unsigned Idx) {
- Bits[Idx / BITWORD_SIZE] ^= 1L << (Idx % BITWORD_SIZE);
+ Bits[Idx / BITWORD_SIZE] ^= BitWord(1) << (Idx % BITWORD_SIZE);
return *this;
}
bool operator[](unsigned Idx) const {
assert (Idx < Size && "Out-of-bounds Bit access.");
- BitWord Mask = 1L << (Idx % BITWORD_SIZE);
+ BitWord Mask = BitWord(1) << (Idx % BITWORD_SIZE);
return (Bits[Idx / BITWORD_SIZE] & Mask) != 0;
}