From da5c53c499b0b697fe4c04d2aca44fb24a44ca33 Mon Sep 17 00:00:00 2001 From: bugdea1er Date: Mon, 23 Sep 2024 22:39:31 +0300 Subject: [PATCH] Inherit `hash` from `tmp::entry` --- include/tmp/directory | 5 +---- include/tmp/file | 5 +---- src/directory.cpp | 6 ------ src/file.cpp | 6 ------ 4 files changed, 2 insertions(+), 20 deletions(-) diff --git a/include/tmp/directory b/include/tmp/directory index 875ab39..723553e 100644 --- a/include/tmp/directory +++ b/include/tmp/directory @@ -4,7 +4,6 @@ #include #include -#include #include #include @@ -78,8 +77,6 @@ private: } // namespace tmp /// The template specialization of `std::hash` for `tmp::directory` -template<> struct TMP_EXPORT std::hash { - std::size_t operator()(const tmp::directory& directory) const noexcept; -}; +template<> struct std::hash : public std::hash {}; #endif // TMP_DIRECTORY_H diff --git a/include/tmp/file b/include/tmp/file index 07ac493..3a1ebc3 100644 --- a/include/tmp/file +++ b/include/tmp/file @@ -4,7 +4,6 @@ #include #include -#include #include #include #include @@ -125,8 +124,6 @@ private: } // namespace tmp /// The template specialization of `std::hash` for `tmp::file` -template<> struct TMP_EXPORT std::hash { - std::size_t operator()(const tmp::file& file) const noexcept; -}; +template<> struct std::hash : public std::hash {}; #endif // TMP_FILE_H diff --git a/src/directory.cpp b/src/directory.cpp index 19bbc9d..b04724b 100644 --- a/src/directory.cpp +++ b/src/directory.cpp @@ -3,7 +3,6 @@ #include "utils.hpp" -#include #include #include #include @@ -104,8 +103,3 @@ directory::~directory() noexcept = default; directory::directory(directory&&) noexcept = default; directory& directory::operator=(directory&&) noexcept = default; } // namespace tmp - -std::size_t std::hash::operator()( - const tmp::directory& directory) const noexcept { - return std::hash()(directory); -} diff --git a/src/file.cpp b/src/file.cpp index 85118cd..a1e0055 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -3,7 +3,6 @@ #include "utils.hpp" -#include #include #include #include @@ -124,8 +123,3 @@ file::~file() noexcept = default; file::file(file&&) noexcept = default; file& file::operator=(file&& other) noexcept = default; } // namespace tmp - -std::size_t -std::hash::operator()(const tmp::file& file) const noexcept { - return std::hash()(file); -}