1
0
Fork 0

Codechange: Allow (Re)setting a range of values in a BaseBitSet.

pull/13551/head
Peter Nelson 2025-02-12 23:42:46 +00:00 committed by Peter Nelson
parent f0777737af
commit 9049710051
1 changed files with 33 additions and 0 deletions

View File

@ -52,6 +52,17 @@ public:
return static_cast<Timpl&>(*this);
}
/**
* Set values from another bitset.
* @param other Bitset of values to set.
* @returns The bit set
*/
inline constexpr Timpl &Set(const Timpl &other)
{
this->data |= other.data;
return static_cast<Timpl&>(*this);
}
/**
* Assign the value-th bit.
* @param value Bit to assign to.
@ -74,6 +85,17 @@ public:
return static_cast<Timpl&>(*this);
}
/**
* Reset values from another bitset.
* @param other Bitset of values to reset.
* @returns The bit set
*/
inline constexpr Timpl &Reset(const Timpl &other)
{
this->data &= ~other.data;
return static_cast<Timpl&>(*this);
}
/**
* Flip the value-th bit.
* @param value Bit to flip.
@ -88,6 +110,17 @@ public:
}
}
/**
* Flip values from another bitset.
* @param other Bitset of values to flip.
* @returns The bit set
*/
inline constexpr Timpl &Flip(const Timpl &other)
{
this->data ^= other.data;
return static_cast<Timpl&>(*this);
}
/**
* Test if the value-th bit is set.
* @param value Bit to check.