Core/Flags: Make operators |= &= and ^= constexpr

This commit is contained in:
Lynix 2018-08-03 20:26:44 +02:00
parent 39d1d31639
commit a363ae312f
3 changed files with 9 additions and 6 deletions

View File

@ -130,6 +130,9 @@ Nazara Engine:
- Fixed bug where index wouldn't be used in String::FindLast and String::FindWord
- Physics 2D contact callbacks now include an arbiter allowing to query/set parameters about the collision
- Added movement with Ctrl in TextAreaWidget
- Added Unicode Data downloader/parser
- Integrated Unicode Data
- Fixed Flags operator |=/&=/^= not being constexpr
Nazara Development Kit:
- Added ImageWidget (#139)

View File

@ -61,9 +61,9 @@ namespace Nz
constexpr bool operator==(const Flags& rhs) const;
constexpr bool operator!=(const Flags& rhs) const;
/*constexpr*/ Flags& operator|=(const Flags& rhs);
/*constexpr*/ Flags& operator&=(const Flags& rhs);
/*constexpr*/ Flags& operator^=(const Flags& rhs);
constexpr Flags& operator|=(const Flags& rhs);
constexpr Flags& operator&=(const Flags& rhs);
constexpr Flags& operator^=(const Flags& rhs);
static constexpr BitField GetFlagValue(E enumValue);

View File

@ -166,7 +166,7 @@ namespace Nz
* This will enable flags which are enabled in parameter object and not in Flag object.
*/
template<typename E>
/*constexpr*/ Flags<E>& Flags<E>::operator|=(const Flags& rhs)
constexpr Flags<E>& Flags<E>::operator|=(const Flags& rhs)
{
m_value |= rhs.m_value;
@ -182,7 +182,7 @@ namespace Nz
* This will disable flags which are disabled in parameter object and enabled in Flag object (and vice-versa).
*/
template<typename E>
/*constexpr*/ Flags<E>& Flags<E>::operator&=(const Flags& rhs)
constexpr Flags<E>& Flags<E>::operator&=(const Flags& rhs)
{
m_value &= rhs.m_value;
@ -199,7 +199,7 @@ namespace Nz
* This will disable flags enabled in both Flags objects and enable those enabled in only one of the Flags objects.
*/
template<typename E>
/*constexpr*/ Flags<E>& Flags<E>::operator^=(const Flags& rhs)
constexpr Flags<E>& Flags<E>::operator^=(const Flags& rhs)
{
m_value ^= rhs.m_value;
m_value &= ValueMask;