File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -329,22 +329,24 @@ class ConcurrentMap {
329
329
//
330
330
331
331
class BitVector {
332
- struct BitRef {
333
- BitRef (u8 &byte, u8 bitpos) : byte(byte), bitpos(bitpos) {}
332
+ class BitRef {
333
+ public:
334
+ BitRef (u8 *byte, u8 bitpos) : byte(byte), bitpos(bitpos) {}
334
335
335
336
BitRef &operator =(bool val) {
336
337
if (val)
337
- byte |= (1 << bitpos);
338
+ * byte |= (1 << bitpos);
338
339
else
339
- byte &= ~(1 << bitpos);
340
+ * byte &= ~(1 << bitpos);
340
341
return *this ;
341
342
}
342
343
343
344
operator bool () const {
344
- return byte & (1 << bitpos);
345
+ return * byte & (1 << bitpos);
345
346
}
346
347
347
- u8 &byte;
348
+ private:
349
+ u8 *byte;
348
350
u8 bitpos;
349
351
};
350
352
@@ -355,7 +357,7 @@ class BitVector {
355
357
}
356
358
357
359
BitRef operator [](i64 i) {
358
- return BitRef (vec[i / 8 ], i % 8 );
360
+ return BitRef (& vec[i / 8 ], i % 8 );
359
361
}
360
362
361
363
private:
You can’t perform that action at this time.
0 commit comments