MCPcopy Create free account
hub / github.com/boostorg/filesystem / auto_fclose

Class auto_fclose

test/cstdio_test.cpp:30–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28bool cleanup = true;
29
30class auto_fclose
31{
32private:
33 std::FILE* m_file;
34
35public:
36 auto_fclose() noexcept : m_file(nullptr) {}
37 explicit auto_fclose(std::FILE* file) noexcept : m_file(file) {}
38 ~auto_fclose() noexcept
39 {
40 if (m_file)
41 std::fclose(m_file);
42 }
43
44 std::FILE* get() const noexcept { return m_file; }
45
46 auto_fclose(auto_fclose const&) = delete;
47 auto_fclose& operator=(auto_fclose const&) = delete;
48};
49
50void test(fs::path const& p)
51{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected