1
0
Fork 0

Codechange: Add Reset() and missing &=/|= operators for BaseBitSet.

pull/14231/head
Peter Nelson 2025-05-06 20:07:45 +01:00 committed by Peter Nelson
parent c4d033967b
commit e0dbbbb032
1 changed files with 24 additions and 2 deletions

View File

@ -76,6 +76,16 @@ public:
return set ? this->Set(value) : this->Reset(value);
}
/**
* Reset all bits.
* @returns The bit set
*/
inline constexpr Timpl &Reset()
{
this->data = 0;
return static_cast<Timpl &>(*this);
}
/**
* Reset the value-th bit.
* @param value Bit to reset.
@ -180,12 +190,24 @@ public:
return this->data == 0;
}
inline constexpr Timpl operator |(const Timpl &other) const
inline constexpr Timpl &operator|=(const Timpl &other)
{
this->data |= other.data;
return static_cast<Timpl &>(*this);
}
inline constexpr Timpl operator|(const Timpl &other) const
{
return Timpl{static_cast<Tstorage>(this->data | other.data)};
}
inline constexpr Timpl operator &(const Timpl &other) const
inline constexpr Timpl &operator&=(const Timpl &other)
{
this->data &= other.data;
return static_cast<Timpl &>(*this);
}
inline constexpr Timpl operator&(const Timpl &other) const
{
return Timpl{static_cast<Tstorage>(this->data & other.data)};
}