From 669c8acba861ea0be2966a7ae3f1f6af8e3f7e5b Mon Sep 17 00:00:00 2001 From: Mike Popoloski Date: Sat, 14 Dec 2024 12:32:59 -0500 Subject: [PATCH] Clean up some old todos --- include/slang/util/Hash.h | 12 ------------ include/slang/util/SmallVector.h | 20 ++------------------ 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/include/slang/util/Hash.h b/include/slang/util/Hash.h index 83ec39599..749cd08b5 100644 --- a/include/slang/util/Hash.h +++ b/include/slang/util/Hash.h @@ -10,9 +10,6 @@ #include #include -// TODO: remove once fs::path in stdlib has a hash impl -#include - #ifdef SLANG_BOOST_SINGLE_HEADER # include #else @@ -210,15 +207,6 @@ struct hash { } }; -// TODO: This is needed as a workaround for missing std::hash<> of paths; -// it was added as a DR to C++17 but not all of our targets have it yet. -template<> -struct hash { - uint64_t operator()(const std::filesystem::path& path) const noexcept { - return std::filesystem::hash_value(path); - } -}; - #define SLANG_HASH_STATICCAST(T) \ template<> \ struct hash { \ diff --git a/include/slang/util/SmallVector.h b/include/slang/util/SmallVector.h index b1c6e9bf8..73244ebe6 100644 --- a/include/slang/util/SmallVector.h +++ b/include/slang/util/SmallVector.h @@ -680,25 +680,9 @@ inline bool operator==(const SmallVectorBase& lhs, const SmallVectorBase& return std::ranges::equal(lhs, rhs); } -// TODO: clean these up once minimum libc++ version has lexicographical_compare_three_way template -inline bool operator<(const SmallVectorBase& lhs, const SmallVectorBase& rhs) { - return std::ranges::lexicographical_compare(lhs, rhs); -} - -template -inline bool operator>(const SmallVectorBase& lhs, const SmallVectorBase& rhs) { - return rhs < lhs; -} - -template -inline bool operator<=(const SmallVectorBase& lhs, const SmallVectorBase& rhs) { - return !(lhs > rhs); -} - -template -inline bool operator>=(const SmallVectorBase& lhs, const SmallVectorBase& rhs) { - return !(lhs < rhs); +inline auto operator<=>(const SmallVectorBase& lhs, const SmallVectorBase& rhs) { + return std::lexicographical_compare_three_way(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); } template