CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
Concat.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 "TypeList.hpp"
11
12#include <type_traits>
13
14namespace CeresEngine::MPL {
15
17 template<typename...> struct ConcatHelper { using type = TypeList<>; };
18
20 template<typename... TTypeLists> using Concat = typename ConcatHelper<TTypeLists...>::type;
21
23 template<typename... Ts> struct ConcatHelper<TypeList<Ts...>> { using type = TypeList<Ts...>; };
24
26 template<typename... Ts0, typename... Ts1, typename... TRest> struct ConcatHelper<TypeList<Ts0...>, TypeList<Ts1...>, TRest...> {
27 using type = Concat<TypeList<Ts0..., Ts1...>, TRest...>;
28 };
29
30} // namespace CeresEngine::MPL
Definition All.hpp:15
typename ConcatHelper< TTypeLists... >::type Concat
Interface type alias.
Definition Concat.hpp:20
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Concat< TypeList< Ts0..., Ts1... >, TRest... > type
Definition Concat.hpp:27
Concat base case: empty lists.
Definition Concat.hpp:17
Compile-time list of types.
Definition TypeList.hpp:15