mirror of
https://github.com/orange-cpp/omath.git
synced 2026-04-22 00:43:27 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user