mirror of
https://github.com/fmang/opustags.git
synced 2025-01-24 08:54:57 +01:00
Merge 541f5d6e2d03aa3b41df9464fa012d1bdf993f60 into d9b051210ba756d28086c9b75e983e84ae11e730
This commit is contained in:
commit
ed39938567
@ -119,13 +119,19 @@ using byte_string_view = std::basic_string_view<uint8_t>;
|
||||
* \{
|
||||
*/
|
||||
|
||||
/** Local helper deleter function. */
|
||||
static void fclose_deleter(FILE* f)
|
||||
{
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Smart auto-closing FILE* handle.
|
||||
*
|
||||
* 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 file : std::unique_ptr<FILE, decltype(&fclose_deleter)> {
|
||||
file(FILE* f = nullptr) : std::unique_ptr<FILE, decltype(&fclose_deleter)>(f, &fclose_deleter) {}
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user