diff --git a/include/tmp/directory b/include/tmp/directory index 2895708..834126e 100644 --- a/include/tmp/directory +++ b/include/tmp/directory @@ -74,12 +74,4 @@ private: }; } // namespace tmp -/// The template specialization of `std::hash` for `tmp::directory` -template<> struct std::hash { - std::size_t operator()(const tmp::directory& directory) const noexcept { - // `std::hash` was not included in the C++17 standard - return filesystem::hash_value(directory); - } -}; - #endif // TMP_DIRECTORY_H diff --git a/include/tmp/file b/include/tmp/file index 877856e..60715c0 100644 --- a/include/tmp/file +++ b/include/tmp/file @@ -86,11 +86,4 @@ private: }; } // namespace tmp -/// The template specialization of `std::hash` for `tmp::file` -template<> struct std::hash { - std::size_t operator()(const tmp::file& file) const noexcept { - return std::hash()(file.native_handle()); - } -}; - #endif // TMP_FILE_H diff --git a/tests/directory.cpp b/tests/directory.cpp index 3c65a0d..0a87770 100644 --- a/tests/directory.cpp +++ b/tests/directory.cpp @@ -152,13 +152,5 @@ TEST(directory, swap) { EXPECT_EQ(fst.path(), snd_path); EXPECT_EQ(snd.path(), fst_path); } - -/// Tests directory hashing -TEST(directory, hash) { - directory tmpdir = directory(); - std::hash hash = std::hash(); - - EXPECT_EQ(hash(tmpdir), fs::hash_value(tmpdir.path())); -} } // namespace } // namespace tmp diff --git a/tests/file.cpp b/tests/file.cpp index 25e4c8a..a0a800b 100644 --- a/tests/file.cpp +++ b/tests/file.cpp @@ -148,14 +148,5 @@ TEST(file, swap) { EXPECT_TRUE(is_open(fst)); EXPECT_TRUE(is_open(snd)); } - -/// Tests file hashing -TEST(file, hash) { - file tmpfile = file(); - std::hash hash = std::hash(); - - EXPECT_EQ(hash(tmpfile), - std::hash()(tmpfile.native_handle())); -} } // namespace } // namespace tmp