CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
All.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 "Rename.hpp"
11#include "TypeList.hpp"
12
13#include <type_traits>
14
16
18 template<template<typename> class, typename...> struct AllHelper : std::true_type {};
19
20 template<template<typename> class TTypePred, typename... Ts> inline constexpr bool All = AllHelper<TTypePred, Ts...>::value;
21
23 template<template<typename> class TTypePred, typename T, typename... Ts>
24 struct AllHelper<TTypePred, T, Ts...> : std::integral_constant<bool, TTypePred<T>::value && All<TTypePred, Ts...>> {};
25
27 template<template<typename> class TMF> struct BoundAll { template<typename... Ts> using type = AllHelper<TMF, Ts...>; };
28
30 template<template<typename> class TMF, typename TL> inline constexpr bool AllTypes = Rename<BoundAll<TMF>::template type, TL>::value;
31
32} // namespace CeresEngine::MPL
Definition All.hpp:15
typename RenameHelper< TNewName, T >::type Rename
Definition Rename.hpp:19
constexpr bool All
Definition All.hpp:20
constexpr bool AllTypes
Unpack a type list into All.
Definition All.hpp:30
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
All base case: return true.
Definition All.hpp:18
Bind All's predicate to TMF.
Definition All.hpp:27