Skip to content

Commit

Permalink
refs #71, added three-way comparison to directory_entry
Browse files Browse the repository at this point in the history
  • Loading branch information
gulrak committed Dec 28, 2020
1 parent ab3cb84 commit 3225d12
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/ghc/filesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,9 @@ class GHC_FS_API_CLASS directory_entry
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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3225d12

Please sign in to comment.