Figure out fill() and isFull()

Stupid casting.
This commit is contained in:
Eryn Wells 2016-04-14 02:35:50 -04:00
parent e92718cad0
commit 58817e7ced

View file

@ -31,6 +31,13 @@ struct Bitmap
: mBitmap(value) : mBitmap(value)
{ } { }
/** Get this bit field's primitive representation. */
operator FieldType()
const
{
return mBitmap;
}
/** Get the status of a single bit. Returns `true` if the bit is 1. */ /** Get the status of a single bit. Returns `true` if the bit is 1. */
bool bool
isSet(usize bit) isSet(usize bit)
@ -82,14 +89,14 @@ struct Bitmap
void void
fill() fill()
{ {
mBitmap = ~(0); mBitmap = FieldType(-1);
} }
bool bool
isFull() isFull()
const const
{ {
return mBitmap != ~(0); return mBitmap == FieldType(-1);
} }
private: private: