EntityComponentMetaSystem
An implementation of an EntityComponent System with template meta-programming.
Loading...
Searching...
No Matches
Contains.hpp
1
2// This work derives from Vittorio Romeo's code used for cppcon 2015 licensed
3// under the Academic Free License.
4// His code is available here: https://github.com/SuperV1234/cppcon2015
5
6
7#ifndef EC_META_CONTAINS_HPP
8#define EC_META_CONTAINS_HPP
9
10#include <type_traits>
11#include "TypeList.hpp"
12
13namespace EC
14{
15 namespace Meta
16 {
17 template <typename T, typename... Types>
19 std::false_type
20 {
21 };
22
23 template <
24 typename T,
25 template <typename...> class TTypeList,
26 typename Type,
27 typename... Types>
28 struct ContainsHelper<T, TTypeList<Type, Types...> > :
29 std::conditional<
30 std::is_same<T, Type>::value,
31 std::true_type,
32 ContainsHelper<T, TTypeList<Types...> >
33 >::type
34 {
35 };
36
37 template <typename T, typename TTypeList>
38 using Contains = std::integral_constant<
40 }
41}
42
43#endif
44
Definition Contains.hpp:20