From 3225d122ac48997071b3dfef8a2452202a30145e Mon Sep 17 00:00:00 2001 From: Steffen Schuemann Date: Mon, 28 Dec 2020 23:20:32 +0100 Subject: [PATCH] refs #71, added three-way comparison to directory_entry --- include/ghc/filesystem.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/ghc/filesystem.hpp b/include/ghc/filesystem.hpp index acb4429..191ef24 100644 --- a/include/ghc/filesystem.hpp +++ b/include/ghc/filesystem.hpp @@ -770,6 +770,9 @@ public: uintmax_t hard_link_count(std::error_code& ec) const noexcept; #endif +#ifdef GHC_HAS_THREEWAY_COMP + std::strong_ordering operator<=>(const directory_entry& rhs) const noexcept; +#endif bool operator<(const directory_entry& rhs) const noexcept; bool operator==(const directory_entry& rhs) const noexcept; bool operator!=(const directory_entry& rhs) const noexcept; @@ -5084,6 +5087,13 @@ GHC_INLINE file_status directory_entry::symlink_status(std::error_code& ec) cons return filesystem::symlink_status(path(), ec); } +#ifdef GHC_HAS_THREEWAY_COMP +GHC_INLINE std::strong_ordering directory_entry::operator<=>(const directory_entry& rhs) const noexcept +{ + return _path <=> rhs._path; +} +#endif + GHC_INLINE bool directory_entry::operator<(const directory_entry& rhs) const noexcept { return _path < rhs._path;