Restore experimental optimized operators &= |= ^= for se_t
They were removed approximately 3 years ago due to their rarity.
This commit is contained in:
@@ -252,6 +252,12 @@ namespace stx
|
|||||||
template <typename T1>
|
template <typename T1>
|
||||||
se_t& operator&=(const T1& rhs)
|
se_t& operator&=(const T1& rhs)
|
||||||
{
|
{
|
||||||
|
if constexpr (std::is_integral_v<T>)
|
||||||
|
{
|
||||||
|
m_data = std::bit_cast<stype, T>(static_cast<T>(std::bit_cast<T>(m_data) & std::bit_cast<T>(static_cast<se_t>(rhs))));
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
*this = value() & rhs;
|
*this = value() & rhs;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -259,6 +265,12 @@ namespace stx
|
|||||||
template <typename T1>
|
template <typename T1>
|
||||||
se_t& operator|=(const T1& rhs)
|
se_t& operator|=(const T1& rhs)
|
||||||
{
|
{
|
||||||
|
if constexpr (std::is_integral_v<T>)
|
||||||
|
{
|
||||||
|
m_data = std::bit_cast<stype, T>(static_cast<T>(std::bit_cast<T>(m_data) | std::bit_cast<T>(static_cast<se_t>(rhs))));
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
*this = value() | rhs;
|
*this = value() | rhs;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -266,6 +278,12 @@ namespace stx
|
|||||||
template <typename T1>
|
template <typename T1>
|
||||||
se_t& operator^=(const T1& rhs)
|
se_t& operator^=(const T1& rhs)
|
||||||
{
|
{
|
||||||
|
if constexpr (std::is_integral_v<T>)
|
||||||
|
{
|
||||||
|
m_data = std::bit_cast<stype, T>(static_cast<T>(std::bit_cast<T>(m_data) ^ std::bit_cast<T>(static_cast<se_t>(rhs))));
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
*this = value() ^ rhs;
|
*this = value() ^ rhs;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user