From 7fe47a9d5b1727a61dc724523b530762f6d6ba19 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Thu, 30 Jun 2022 21:38:53 -0700 Subject: Restructure project --- app/source/Cplt/Utils/VectorHash.hpp | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 app/source/Cplt/Utils/VectorHash.hpp (limited to 'app/source/Cplt/Utils/VectorHash.hpp') diff --git a/app/source/Cplt/Utils/VectorHash.hpp b/app/source/Cplt/Utils/VectorHash.hpp new file mode 100644 index 0000000..f649367 --- /dev/null +++ b/app/source/Cplt/Utils/VectorHash.hpp @@ -0,0 +1,46 @@ +#pragma once + +#include +#include + +#include +#include + +template +struct std::hash> +{ + size_t operator()(const Vec2& vec) const + { + size_t result; + HashUtils::Combine(result, vec.x); + HashUtils::Combine(result, vec.y); + return result; + } +}; + +template +struct std::hash> +{ + size_t operator()(const Vec3& vec) const + { + size_t result; + HashUtils::Combine(result, vec.x); + HashUtils::Combine(result, vec.y); + HashUtils::Combine(result, vec.z); + return result; + } +}; + +template +struct std::hash> +{ + size_t operator()(const Vec4& vec) const + { + size_t result; + HashUtils::Combine(result, vec.x); + HashUtils::Combine(result, vec.y); + HashUtils::Combine(result, vec.z); + HashUtils::Combine(result, vec.w); + return result; + } +}; -- cgit v1.2.3-70-g09d2