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

@@ -101,7 +101,7 @@ public:
}
// prepare file with only read permission (boost process opens with read_write)
auto inputFile = Trinity::make_unique_ptr_with_deleter(!input_file.empty() ? fopen(input_file.c_str(), "rb") : nullptr, &::fclose);
auto inputFile = Trinity::make_unique_ptr_with_deleter<&::fclose>(!input_file.empty() ? fopen(input_file.c_str(), "rb") : nullptr);
std::error_code ec;