# Node ID 49338f652153307b3699830cbaca0fa0eb2799e3 # Parent f07dbaea0ba36b174659cb8fe467193fb739f447 diff --git a/src/base/bitunion.hh b/src/base/bitunion.hh --- a/src/base/bitunion.hh +++ b/src/base/bitunion.hh @@ -100,6 +100,12 @@ this->setBits(first, last, _data); return _data; } + + uint64_t + operator=(Bitfield const & other) + { + return *this = (uint64_t)other; + } }; //A class which specializes the above so that it can only be read @@ -113,6 +119,9 @@ private: uint64_t operator=(const uint64_t _data); + + uint64_t + operator=(const Bitfield& other); }; //Similar to the above, but only allows writing. @@ -150,6 +159,12 @@ this->setBits(first, last, _data); return _data; } + + int64_t + operator=(SignedBitfield const & other) + { + return *this = (int64_t)other; + } }; //A class which specializes the above so that it can only be read @@ -163,6 +178,9 @@ private: int64_t operator=(const int64_t _data); + + int64_t + operator=(const SignedBitfield& other); }; //Similar to the above, but only allows writing. @@ -173,11 +191,7 @@ operator const int64_t () const; public: - int64_t operator=(const int64_t _data) - { - *((SignedBitfield *)this) = _data; - return _data; - } + using SignedBitfield::operator=; }; }; @@ -215,6 +229,13 @@ return _data; } + Type + operator=(BitUnionOperators const & other) + { + Base::__data = other; + return Base::__data; + } + bool operator<(Base const & base) const {