Adds hash support for Vector2, Vector3, and Vector4

Implements `std::hash` specialization for `omath::Vector2`, `omath::Vector3`, and `omath::Vector4` with float components.

This enables usage of these vector types as keys in hash-based containers, such as `std::unordered_map` and `std::unordered_set`.
This commit is contained in:
2025-10-14 13:00:28 +03:00
parent a8eac87f02
commit 7be3bde498
3 changed files with 32 additions and 0 deletions

View File

@@ -273,6 +273,7 @@ namespace omath
template<> struct std::hash<omath::Vector3<float>>
{
[[nodiscard]]
std::size_t operator()(const omath::Vector3<float>& vec) const noexcept
{
std::size_t hash = 0;