Skip to content

Instantly share code, notes, and snippets.

#include <memory>
#include <cstdio>
/////////////////////////////////////////////////////////////////////////////
typedef std::unique_ptr<std::FILE, int (*)(std::FILE *)> unique_file_ptr;
typedef std::shared_ptr<std::FILE> shared_file_ptr;
static shared_file_ptr make_shared_file(const char * filename, const char * flags)
{