src/utility/Deleters.cpp
raw| 1 | #include <pbcopper/utility/Deleters.h> |
| 2 | |
| 3 | #include <cstdlib> |
| 4 | |
| 5 | namespace PacBio { |
| 6 | namespace Utility { |
| 7 | |
| 8 | void FileDeleter::operator()(std::FILE* fp) const noexcept |
| 9 | { |
| 10 | if (fp) { |
| 11 | std::fclose(fp); |
| 12 | } |
| 13 | fp = nullptr; |
| 14 | } |
| 15 | |
| 16 | void FreeDeleter::operator()(void* p) const noexcept { std::free(p); } |
| 17 | |
| 18 | void FreeDeleter::operator()(const void* p) const noexcept { operator()(const_cast<void*>(p)); } |
| 19 | |
| 20 | } // namespace Utility |
| 21 | } // namespace PacBio |