refs #71, added three-way comparison to directory_entry

This commit is contained in:
Steffen Schuemann 2020-12-28 23:20:32 +01:00
parent ab3cb84648
commit 3225d122ac

View File

@ -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;