mirror of
https://github.com/love2d/love.git
synced 2026-08-12 16:40:57 +02:00
Added a static assert to make sure type IDs always have a corresponding type name.
--HG-- branch : minor
This commit is contained in:
@@ -202,6 +202,8 @@ StringMap<Type, TYPE_MAX_ENUM>::Entry typeEntries[] =
|
||||
|
||||
StringMap<Type, TYPE_MAX_ENUM> types(typeEntries, sizeof(typeEntries));
|
||||
|
||||
static_assert((sizeof(typeEntries) / sizeof(typeEntries[0])) == TYPE_MAX_ENUM, "Type name array size doesn't match the total number of type IDs!");
|
||||
|
||||
bool getType(const char *in, love::Type &out)
|
||||
{
|
||||
return types.find(in, out);
|
||||
|
||||
Reference in New Issue
Block a user