Skip to content

Commit

Permalink
Clean up some old todos
Browse files Browse the repository at this point in the history
  • Loading branch information
MikePopoloski committed Dec 14, 2024
1 parent f4b480d commit 669c8ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
12 changes: 0 additions & 12 deletions include/slang/util/Hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
#include <array>
#include <cstring>

// TODO: remove once fs::path in stdlib has a hash impl
#include <filesystem>

#ifdef SLANG_BOOST_SINGLE_HEADER
# include <boost_unordered.hpp>
#else
Expand Down Expand Up @@ -210,15 +207,6 @@ struct hash<Enum> {
}
};

// 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<std::filesystem::path> {
uint64_t operator()(const std::filesystem::path& path) const noexcept {
return std::filesystem::hash_value(path);
}
};

#define SLANG_HASH_STATICCAST(T) \
template<> \
struct hash<T> { \
Expand Down
20 changes: 2 additions & 18 deletions include/slang/util/SmallVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -680,25 +680,9 @@ inline bool operator==(const SmallVectorBase<T>& lhs, const SmallVectorBase<T>&
return std::ranges::equal(lhs, rhs);
}

// TODO: clean these up once minimum libc++ version has lexicographical_compare_three_way
template<typename T>
inline bool operator<(const SmallVectorBase<T>& lhs, const SmallVectorBase<T>& rhs) {
return std::ranges::lexicographical_compare(lhs, rhs);
}

template<typename T>
inline bool operator>(const SmallVectorBase<T>& lhs, const SmallVectorBase<T>& rhs) {
return rhs < lhs;
}

template<typename T>
inline bool operator<=(const SmallVectorBase<T>& lhs, const SmallVectorBase<T>& rhs) {
return !(lhs > rhs);
}

template<typename T>
inline bool operator>=(const SmallVectorBase<T>& lhs, const SmallVectorBase<T>& rhs) {
return !(lhs < rhs);
inline auto operator<=>(const SmallVectorBase<T>& lhs, const SmallVectorBase<T>& rhs) {
return std::lexicographical_compare_three_way(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
}

template<typename T>
Expand Down

0 comments on commit 669c8ac

Please sign in to comment.