1#ifndef TATOOINE_TEMPLATE_HELPER_H
2#define TATOOINE_TEMPLATE_HELPER_H
8template <
typename T,
typename... Ts>
12template <
typename... Ts>
19template <
typename... Ts>
27template <
typename T0,
typename T1,
typename... Ts>
32template <
typename... Ts>
36template <std::size_t i,
typename... Ts>
39template <
typename T,
typename... Ts>
44template <std::size_t i,
typename T,
typename... Ts>
49template <std::size_t i,
typename... Ts>
53template <std::size_t i,
typename T, T... Vs>
56template <
typename T, T V0, T... Vs>
58 static constexpr T value = V0;
61template <std::size_t i,
typename T, T V0, T... Vs>
63 static constexpr T value =
getval_impl<i - 1, T, Vs...>::value;
66template <std::size_t i,
typename T, T... Vs>
70constexpr auto getval(
const unsigned int ) -> T {
73template <
typename T,
typename T0,
typename... Ts>
74constexpr auto getval(
const unsigned int i, T0&& t0, Ts&&... ts) {
75 if (i == 0) {
return static_cast<T
>(t0); }
76 return getval<T>(i - 1, std::forward<Ts>(ts)...);
80template <
typename... Ts>
83template <
typename... Ts>
86template <
typename T0,
typename T1,
typename... Ts>
88 template <
typename... Flipped_Ts>
90 return flipped<Flipped_Ts..., T0>{};
100template <
typename... Ts>
105template <
typename... Ts>
110 static constexpr bool value =
true;
113template <
typename T0,
typename T1,
typename... Ts>
115 static constexpr bool value =
116 std::is_same<T0, T1>::value &&
all_same_t<T1, Ts...>::value;
119template <
typename... Ts>
Definition: template_helper.h:6
typename back_t< Ts... >::type back
Definition: template_helper.h:33
auto flip()
Definition: template_helper.h:101
static constexpr auto getval_v
Definition: template_helper.h:67
typename front_t< Ts... >::type front
Definition: template_helper.h:13
constexpr auto getval(const unsigned int) -> T
Definition: template_helper.h:70
typename get_t< i, Ts... >::type get
Definition: template_helper.h:50
static constexpr bool all_same
Definition: template_helper.h:120
Definition: template_helper.h:106
typename back_t< T1, Ts... >::type type
Definition: template_helper.h:29
T type
Definition: template_helper.h:24
Definition: template_helper.h:20
static constexpr auto flip(flipped< Flipped_Ts... > &&)
Definition: template_helper.h:89
static constexpr auto flip()
Definition: template_helper.h:92
static constexpr auto flip()
Definition: template_helper.h:97
Definition: template_helper.h:84
Definition: template_helper.h:81
Definition: template_helper.h:9
T type
Definition: template_helper.h:10
T type
Definition: template_helper.h:41
typename get_t< i - 1, Ts... >::type type
Definition: template_helper.h:46
Definition: template_helper.h:37
Definition: template_helper.h:54