Core/Flags: Make aware of enumeration max value

Preventing it to enable bits that have no corresponding enum value
This commit is contained in:
Lynix
2016-12-12 15:10:37 +01:00
parent e9061a6cf8
commit 876fec6f5e
3 changed files with 11 additions and 4 deletions

View File

@@ -65,6 +65,7 @@ namespace Nz
struct EnumAsFlags<BufferUsage>
{
static constexpr bool value = true;
static constexpr int max = BufferUsage_Max;
};
using BufferUsageFlags = Flags<BufferUsage>;
@@ -456,6 +457,7 @@ namespace Nz
struct EnumAsFlags<WindowStyle>
{
static constexpr bool value = true;
static constexpr int max = WindowStyle_Max;
};
using WindowStyleFlags = Flags<WindowStyle>;