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
12
#include "
CeresEngine/Foundation/Hash.hpp
"
13
14
namespace
CeresEngine
{
15
17
template
<
typename
T, std::
size_t
N>
using
Array
= std::array<T, N>;
18
19
}
// namespace CeresEngine
20
21
template
<
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
};
Hash.hpp
CeresEngine
Definition
Application.hpp:19
CeresEngine::combine
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
CeresEngine::Array
std::array< T, N > Array
Array is a container that encapsulates fixed size arrays.
Definition
Array.hpp:17
Sources
CeresEngine
Foundation
Container
Array.hpp
Generated by
1.9.8