type_traits.h
Go to the documentation of this file.
1 
10 #pragma once
11 
12 namespace illumina { namespace interop
13 {
14 
16  struct null_type{};
17 
19  template<class T, class U>
20  struct type_list
21  {
23  typedef T head_t;
25  typedef U tail_t;
26  };
28  template<
29  typename T1=null_type, typename T2=null_type, typename T3=null_type, typename T4=null_type,
30  typename T5=null_type, typename T6=null_type, typename T7=null_type, typename T8=null_type,
31  typename T9=null_type, typename T10=null_type, typename T11=null_type, typename T12=null_type,
32  typename T13=null_type, typename T14=null_type, typename T15=null_type, typename T16=null_type,
33  typename T17=null_type, typename T18=null_type, typename T19=null_type, typename T20=null_type,
34  typename T21=null_type, typename T22=null_type, typename T23=null_type, typename T24=null_type,
35  typename T25=null_type, typename T26=null_type>
37  {
38  private:
39  typedef typename make_type_list<
40  T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26
42  public:
45  };
47  template<>
48  struct make_type_list<>
49  {
52  };
54  template<class TypeList, template<class>class Transform>
60  template<class T1, class T2, template<class>class Transform>
61  struct transform_type_list< type_list<T1, T2>, Transform >
62  {
65  };
70  template<class T1, template<class>class Transform>
71  struct transform_type_list< type_list<T1, null_type>, Transform >
72  {
75  };
80  template<template<class>class Transform>
81  struct transform_type_list< null_type, Transform >
82  {
85  };
86 
88  struct true_type
89  {
90  enum{
92  value = true
93  };
94  };
96  struct false_type
97  {
98  enum{
100  value = false
101  };
102  };
104  template<typename T> struct is_pointer : false_type {};
106  template<typename T> struct is_pointer<T*> : true_type {};
108  template<typename T> struct is_const : false_type {};
110  template<typename T> struct is_const<const T> : true_type {};
112  template<bool B, typename T, typename F> struct conditional { typedef T type; };
114  template<typename T, typename F> struct conditional<false, T, F> { typedef F type; };
116  template<typename T1, typename T2>
117  struct is_same : false_type {};
119  template<typename T>
120  struct is_same<T,T>: true_type {};
122  template<typename T1, typename T2>
125  template<typename T>
127 
130  template<typename T, T v>
132  {
134  typedef T value_t;
141  static value_t value(){ return v; }
146  operator value_t()const { return v; }/*noexcept*/
151  value_t operator()()const { return v; }/*noexcept*/
156  static pointer_t null(){return 0;}
157  };
160  template<int v>
161  struct int_constant_type : public constant_type<int, v>{};
162 }}
163 
F type
Definition: type_traits.h:114
Definition: enum_description.h:15
Definition: type_traits.h:20
static pointer_t null()
Definition: type_traits.h:156
T value_t
Definition: type_traits.h:134
Definition: type_traits.h:108
null_type result_t
Definition: type_traits.h:51
type_list< typename Transform< T1 >::result_t, null_type > result_t
Definition: type_traits.h:74
Definition: type_traits.h:36
U tail_t
Definition: type_traits.h:25
Definition: type_traits.h:88
Definition: type_traits.h:161
value_t operator()() const
Definition: type_traits.h:151
Definition: type_traits.h:131
Definition: type_traits.h:104
Definition: type_traits.h:112
Definition: enums.h:301
type_list< T1, tail_result_t > result_t
Definition: type_traits.h:44
Definition: type_traits.h:117
Definition: type_traits.h:100
Definition: type_traits.h:123
type_list< typename Transform< T1 >::result_t, typename transform_type_list< T2, Transform >::result_t > result_t
Definition: type_traits.h:64
Definition: type_traits.h:92
Definition: type_traits.h:55
Definition: type_traits.h:16
Definition: type_traits.h:96
T type
Definition: type_traits.h:112
constant_type< T, v > * pointer_t
Definition: type_traits.h:136
T head_t
Definition: type_traits.h:23
static value_t value()
Definition: type_traits.h:141