mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-27 12:46:06 +00:00
LibGfx/Point: Add hash trait for Point<T>
This commit is contained in:
parent
90ada407db
commit
522f0841fd
Notes:
sideshowbarker
2024-07-18 04:23:25 +09:00
Author: https://github.com/mustafaquraish
Commit: 522f0841fd
Pull-request: https://github.com/SerenityOS/serenity/pull/9830
Reviewed-by: https://github.com/linusg
1 changed files with 9 additions and 0 deletions
|
@ -267,3 +267,12 @@ bool encode(Encoder&, Gfx::IntPoint const&);
|
|||
bool decode(Decoder&, Gfx::IntPoint&);
|
||||
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
struct AK::Traits<Gfx::Point<T>> : public AK::GenericTraits<Gfx::Point<T>> {
|
||||
static constexpr bool is_trivial() { return false; }
|
||||
static unsigned hash(Gfx::Point<T> const& point)
|
||||
{
|
||||
return pair_int_hash(AK::Traits<T>::hash(point.x()), AK::Traits<T>::hash(point.y()));
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue