|
IPPL (Independent Parallel Particle Layer)
IPPL
|
#include <TypeUtils.h>
Public Types | |
| template<bool B, class T, class F> | |
| using | cond = std::conditional_t<B, T, F> |
| template<typename... T> | |
| using | variant = std::variant<T...> |
| using | Check = Verifier<Next, Added...> |
| typedef cond< Check::enable, typename ConstructVariant< variant< ToAdd... >, variant< typename Check::type, Added... >, Verifier >::type, typename ConstructVariant< variant< ToAdd... >, variant< Added... >, Verifier >::type > | type |
Constructs a variant type containing all the provided types that fulfill a certain condition. This is done by recursively adding types to the variant based on the inclusion criteria.
The default verification struct is IsPresent defined above, which includes the type if it has not already been added to the variant before. This is useful if the provided types include duplicates, e.g. if they are type aliases that can sometimes refer to the same type. In particular, Kokkos memory spaces can sometimes have different names but refer to the same memory space. Variants do not allow duplicate types to appear in their parameter packs; each type may only appear once.
The verification struct can be user defined as long as it conforms to the variant verification struct interface. The struct must accept at least a parameter pack; the first parameter is the type currently being checked and the rest are the types already added to the variant. The struct must expose a boolean enable that indicates whether the next type should be included in the variant. The struct must also expose a type type, which is the type to be added to the variant
| Next | the next type to add to the variant |
| ToAdd... | the remaining types waiting to be added to the variant |
| Added... | the types that have already been added to the variant |
| Verifier | the variant verification struct |
Definition at line 121 of file TypeUtils.h.
| using ippl::detail::ConstructVariant< std::variant< Next, ToAdd... >, std::variant< Added... >, Verifier >::Check = Verifier<Next, Added...> |
Definition at line 128 of file TypeUtils.h.
| using ippl::detail::ConstructVariant< std::variant< Next, ToAdd... >, std::variant< Added... >, Verifier >::cond = std::conditional_t<B, T, F> |
Definition at line 124 of file TypeUtils.h.
| typedef cond< Check::enable, typename ConstructVariant<variant<ToAdd...>, variant<typename Check::type, Added...>, Verifier>::type, typename ConstructVariant<variant<ToAdd...>, variant<Added...>, Verifier>::type> ippl::detail::ConstructVariant< std::variant< Next, ToAdd... >, std::variant< Added... >, Verifier >::type |
Definition at line 137 of file TypeUtils.h.
| using ippl::detail::ConstructVariant< std::variant< Next, ToAdd... >, std::variant< Added... >, Verifier >::variant = std::variant<T...> |
Definition at line 126 of file TypeUtils.h.