Ported the obj parser.
This commit is contained in:
18
include/util/array_hash.hpp
Normal file
18
include/util/array_hash.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
|
||||
template<class T, size_t N>
|
||||
struct std::hash<std::array<T, N>>
|
||||
{
|
||||
auto operator() (const std::array<T, N>& key) const {
|
||||
auto hasher = std::hash<T>{};
|
||||
auto result = std::size_t{};
|
||||
for (const auto& element : key)
|
||||
{
|
||||
result = result * 31 + hasher(element);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user