Core/Utilities: Extend make_unique_ptr_with_deleter functionality to allow it to create deleters with compile time constant functions (reduces its size to just sizeof(void*))

This commit is contained in:
Shauren
2024-10-01 21:03:44 +02:00
parent 0d496b14d5
commit b13b5142f1
16 changed files with 207 additions and 88 deletions

View File

@@ -46,7 +46,7 @@ bool LoadGameObjectModelList(std::string const& dataPath)
{
uint32 oldMSTime = getMSTime();
auto model_list_file = Trinity::make_unique_ptr_with_deleter(fopen((dataPath + "vmaps/" + VMAP::GAMEOBJECT_MODELS).c_str(), "rb"), &::fclose);
auto model_list_file = Trinity::make_unique_ptr_with_deleter<&::fclose>(fopen((dataPath + "vmaps/" + VMAP::GAMEOBJECT_MODELS).c_str(), "rb"));
if (!model_list_file)
{
TC_LOG_ERROR("misc", "Unable to open '{}' file.", VMAP::GAMEOBJECT_MODELS);