55 template <
class T,
class... Rest>
class Pack : Pack<Rest...> {
56 using Base = Pack<Rest...>;
61 using var_type =
typename T::var_type;
74 template<
typename Func>
75 KOKKOS_INLINE_FUNCTION
void for_each(Func func) {
89 template<
typename Func>
90 KOKKOS_INLINE_FUNCTION
void for_each_labeled(Func func)
const {
92 Base::for_each_labeled(func);
105 KOKKOS_INLINE_FUNCTION
const auto&
get()
const{
106 if constexpr(T::name==FN){
109 return Base::template get<FN>();
123 KOKKOS_INLINE_FUNCTION
auto&
get() {
124 if constexpr(T::name==FN){
127 return Base::template get<FN>();
140 template <
class T>
class Pack<T> {
145 using var_type =
typename T::var_type;
153 template<
typename Func>
154 KOKKOS_INLINE_FUNCTION
void for_each(Func func){
167 template<
typename Func>
168 KOKKOS_INLINE_FUNCTION
void for_each_labeled(Func func)
const{
182 KOKKOS_INLINE_FUNCTION
const auto&
get()
const{
183 if constexpr(T::name==FN){
186 static_assert(T::name==FN,
"No such field name found in this pack");
199 KOKKOS_INLINE_FUNCTION
auto&
get(){
200 if constexpr(T::name==FN){
203 static_assert(T::name==FN,
"No such field name found in this pack");
218 template<
typename Pack1,
typename Pack2>
219 struct PackConcatenator;
231 template<
typename... Types1,
typename... Types2>
232 struct PackConcatenator<Pack<Types1...>, Pack<Types2...>> {
233 using type = Pack<Types1..., Types2...>;
244 template<
typename Pack1,
typename Pack2>
245 using ConcatenatePacks =
typename PackConcatenator<Pack1, Pack2>::type;