Core/Flags: Add AutoFlag property to disable automatic bit shifting

This commit is contained in:
Jérôme Leclercq
2021-02-19 14:45:37 +01:00
parent 080fd9c7eb
commit 32dcc11258
2 changed files with 20 additions and 10 deletions

View File

@@ -258,7 +258,10 @@ namespace Nz
template<typename E>
constexpr typename Flags<E>::BitField Flags<E>::GetFlagValue(E enumValue)
{
return 1U << static_cast<BitField>(enumValue);
if constexpr (AutoFlag)
return 1U << static_cast<BitField>(enumValue);
else
return enumValue;
}
/*!