LibGfx: Add hash traits for the Size family

This commit is contained in:
Andreas Kling 2024-02-24 08:30:15 +01:00
parent 11b4216e65
commit 2484324f9a
Notes: sideshowbarker 2024-07-16 20:39:14 +09:00

View file

@ -220,3 +220,12 @@ template<>
ErrorOr<Gfx::IntSize> decode(Decoder&);
}
template<typename T>
struct AK::Traits<Gfx::Size<T>> : public AK::DefaultTraits<Gfx::Size<T>> {
static constexpr bool is_trivial() { return false; }
static unsigned hash(Gfx::Size<T> const& size)
{
return pair_int_hash(AK::Traits<T>::hash(size.width()), AK::Traits<T>::hash(size.height()));
}
};