[nostalgia/core] Make AssetManager type name verification a static_assert

This commit is contained in:
Gary Talent 2021-12-01 01:44:03 -06:00
parent 596c0718e1
commit eef1bfcbd6

View File

@ -170,13 +170,8 @@ class AssetManager {
template<typename T>
AssetTypeManager<T> *getTypeManager() noexcept {
#if __cplusplus >= 202002L
constexpr auto typeName = ox::getModelTypeName<T>();
constexpr auto typeName = ox::ModelTypeName_v<T>;
static_assert(ox_strcmp(typeName, "") != 0, "Types must have TypeName to use AssetManager");
#else
const auto typeName = ox::getModelTypeName<T>();
oxAssert(ox_strcmp(typeName, "") != 0, "Types must have TypeName to use AssetManager");
#endif
auto &am = m_assetTypeManagers[typeName];
if (!am) {
am = ox::make_unique<AssetTypeManager<T>>();