From bc05e9bd4b945de09cd5420677c3ed10df2f2ed0 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 18 Jun 2020 07:35:06 -0400 Subject: [PATCH] CResource: Make StaticType() constexpr These only return enum values, so this can be trivially made constexpr --- src/Core/Resource/CResource.h | 2 +- src/Core/Resource/Script/Property/CStructProperty.h | 2 +- src/Core/Resource/Script/Property/IProperty.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Core/Resource/CResource.h b/src/Core/Resource/CResource.h index 0b037490..c5908ef2 100644 --- a/src/Core/Resource/CResource.h +++ b/src/Core/Resource/CResource.h @@ -16,7 +16,7 @@ // Must be included on every CResource subclass. #define DECLARE_RESOURCE_TYPE(ResourceTypeEnum) \ public: \ - static EResourceType StaticType() \ + static constexpr EResourceType StaticType() \ { \ return EResourceType::ResourceTypeEnum; \ } \ diff --git a/src/Core/Resource/Script/Property/CStructProperty.h b/src/Core/Resource/Script/Property/CStructProperty.h index 18824860..de323180 100644 --- a/src/Core/Resource/Script/Property/CStructProperty.h +++ b/src/Core/Resource/Script/Property/CStructProperty.h @@ -32,7 +32,7 @@ public: void InitFromArchetype(IProperty* pOther) override; bool ShouldSerialize() const override; - static EPropertyType StaticType() { return EPropertyType::Struct; } + static constexpr EPropertyType StaticType() { return EPropertyType::Struct; } }; #endif diff --git a/src/Core/Resource/Script/Property/IProperty.h b/src/Core/Resource/Script/Property/IProperty.h index 5b66584c..53e979ea 100644 --- a/src/Core/Resource/Script/Property/IProperty.h +++ b/src/Core/Resource/Script/Property/IProperty.h @@ -361,7 +361,7 @@ public: mDefaultValue = kInDefaultValue; } - static EPropertyType StaticType() { return PropEnum; } + static constexpr EPropertyType StaticType() { return PropEnum; } }; template