Skip to content

Commit

Permalink
[ELF] Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
rui314 committed Sep 29, 2021
1 parent a2c9d0a commit a6c75e9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mold.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ class ConcurrentMap {
//

class BitVector {
struct BitRef {
class BitRef {
public:
BitRef(u8 &byte, u8 bitpos) : byte(byte), bitpos(bitpos) {}

BitRef &operator=(bool val) {
Expand All @@ -340,10 +341,16 @@ class BitVector {
return *this;
}

BitRef &operator=(const BitRef &other) {
*this = (bool)other;
return *this;
}

operator bool() const {
return byte & (1 << bitpos);
}

private:
u8 &byte;
u8 bitpos;
};
Expand Down

0 comments on commit a6c75e9

Please sign in to comment.