CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
Array.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include <array>
11
13
14namespace CeresEngine {
15
17 template<typename T, std::size_t N> using Array = std::array<T, N>;
18
19} // namespace CeresEngine
20
21template<typename T, size_t N> struct std::hash<CeresEngine::Array<T, N>> {
22 using Type = CeresEngine::Array<T, N>;
23 inline size_t operator()(const Type& object) const noexcept {
24 size_t seed = 0;
25 for(const T& value : object) {
26 CeresEngine::combine(seed, value);
27 }
28 return seed;
29 }
30};
Definition Application.hpp:19
constexpr void combine(std::size_t &seed, const T &v)
Generates a new hash for the provided type using the default standard hasher and combines it with a p...
Definition Hash.hpp:32
std::array< T, N > Array
Array is a container that encapsulates fixed size arrays.
Definition Array.hpp:17