IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
ippl::detail::ConstructVariant< std::variant< Next, ToAdd... >, std::variant< Added... >, Verifier > Struct Template Reference

#include <TypeUtils.h>

Inheritance diagram for ippl::detail::ConstructVariant< std::variant< Next, ToAdd... >, std::variant< Added... >, Verifier >:
Collaboration diagram for ippl::detail::ConstructVariant< std::variant< Next, ToAdd... >, std::variant< Added... >, Verifier >:

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

Detailed Description

template<typename Next, typename... ToAdd, typename... Added, template< typename... > class Verifier>
struct ippl::detail::ConstructVariant< std::variant< Next, ToAdd... >, std::variant< Added... >, Verifier >

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

Template Parameters
Nextthe 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
Verifierthe variant verification struct

Definition at line 121 of file TypeUtils.h.

Member Typedef Documentation

◆ Check

template<typename Next, typename... ToAdd, typename... Added, template< typename... > class Verifier>
using ippl::detail::ConstructVariant< std::variant< Next, ToAdd... >, std::variant< Added... >, Verifier >::Check = Verifier<Next, Added...>

Definition at line 128 of file TypeUtils.h.

◆ cond

template<typename Next, typename... ToAdd, typename... Added, template< typename... > class Verifier>
template<bool B, class T, class F>
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.

◆ type

template<typename Next, typename... ToAdd, typename... Added, template< typename... > class Verifier>
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.

◆ variant

template<typename Next, typename... ToAdd, typename... Added, template< typename... > class Verifier>
template<typename... T>
using ippl::detail::ConstructVariant< std::variant< Next, ToAdd... >, std::variant< Added... >, Verifier >::variant = std::variant<T...>

Definition at line 126 of file TypeUtils.h.


The documentation for this struct was generated from the following file: