1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 05:34:58 +00:00

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

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()));
}
};