Merge fb3eb7298defe0d8cf14356f8f7ee661714d83bf into d9b051210ba756d28086c9b75e983e84ae11e730

This commit is contained in:
Eddy L O Jansson 2024-10-22 17:40:41 +02:00 committed by GitHub
commit dd4704ffda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -124,8 +124,14 @@ using byte_string_view = std::basic_string_view<uint8_t>;
*
* It implictly converts from an already opened FILE*.
*/
struct file : std::unique_ptr<FILE, decltype(&fclose)> {
file(FILE* f = nullptr) : std::unique_ptr<FILE, decltype(&fclose)>(f, &fclose) {}
struct fclose_deleter {
void operator()(FILE *f) const noexcept {
fclose(f);
}
};
struct file : std::unique_ptr<FILE, struct fclose_deleter> {
file(FILE* f = nullptr) : std::unique_ptr<FILE, struct fclose_deleter>(f) {}
};
/**