Skip to content

Commit

Permalink
Use c++20
Browse files Browse the repository at this point in the history
  • Loading branch information
wtholliday committed Jun 3, 2024
1 parent 23c7070 commit 6c8fbab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/vger/vger_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ struct TextLayoutKey {
float size;
int align;
float breakRowWidth = -1;

friend bool operator==(const TextLayoutKey&, const TextLayoutKey&) = default;
friend bool operator!=(const TextLayoutKey&, const TextLayoutKey&) = default;
};

inline void hash_combine(size_t& seed) { }
Expand All @@ -40,9 +43,6 @@ inline void hash_combine(size_t& seed, const T& v, Rest... rest) {
}

#define MAKE_HASHABLE(Type, ...) \
inline auto __tie(const Type& t) { return std::tie(__VA_ARGS__); } \
inline bool operator==(const Type& lhs, const Type& rhs) { return __tie(lhs) == __tie(rhs); } \
inline bool operator!=(const Type& lhs, const Type& rhs) { return __tie(lhs) != __tie(rhs); } \
namespace std {\
template<> struct hash<Type> {\
size_t operator()(const Type &t) const {\
Expand Down

0 comments on commit 6c8fbab

Please sign in to comment.