SUNphi  1.0
TupleOrder.hpp File Reference

Defines filtering and reordering of Tuple. More...

Go to the source code of this file.

Typedefs

template<typename TpToSearch , typename TpToProbe >
using SUNphi::PosOfTypes = decltype(_posOfTypes< ASSERT_IF_NOT_PRESENT >(TpToSearch{}, TpToProbe{}))
 
template<typename TpToSearch , typename TpToProbe >
using SUNphi::PosOfTypesNotAsserting = decltype(_posOfTypes< DO_NOT_ASSERT_IF_NOT_PRESENT >(TpToSearch{}, TpToProbe{}))
 

Functions

template<bool assertIfNotPresent, typename T >
constexpr int SUNphi::_posOfType (T, Tuple<>)
 
template<bool assertIfNotPresent, typename T , typename Head , typename... Tail>
constexpr int SUNphi::_posOfType (T, Tuple< Head, Tail... >)
 
template<bool assertIfNotPresent, typename... T, typename TP >
auto SUNphi::_posOfTypes (Tuple< T... > t, TP tp) -> IntSeq< _posOfType< assertIfNotPresent >(T
 Position of the types T in the Tuple TP, asserting or not. More...
 

Variables

template<typename T , typename Tp >
constexpr int SUNphi::posOfType
 
template<typename T , typename Tp >
constexpr int SUNphi::posOfTypeNotAsserting
 
 SUNphi::TP {})...>
 

Detailed Description

Defines filtering and reordering of Tuple.

Definition in file TupleOrder.hpp.

Typedef Documentation

template<typename TpToSearch , typename TpToProbe >
using SUNphi::PosOfTypes = typedef decltype(_posOfTypes<ASSERT_IF_NOT_PRESENT>(TpToSearch{},TpToProbe{}))

Position of the Tuple types TpToSearch in the Tuple TpToProbe, asserting

An expection is issued if the type is not founs

Definition at line 110 of file TupleOrder.hpp.

template<typename TpToSearch , typename TpToProbe >
using SUNphi::PosOfTypesNotAsserting = typedef decltype(_posOfTypes<DO_NOT_ASSERT_IF_NOT_PRESENT>(TpToSearch{},TpToProbe{}))

Position of the Tuple types TpToSearch in the Tuple TpToProbe, not asserting

NOT_PRESENT is returned if the type is not present

Definition at line 118 of file TupleOrder.hpp.

Function Documentation

template<bool assertIfNotPresent, typename T >
constexpr int SUNphi::_posOfType ( ,
Tuple<>   
)

Gets the position of a type in a tuple

Internal implementation, empty case

Definition at line 19 of file TupleOrder.hpp.

template<bool assertIfNotPresent, typename T , typename Head , typename... Tail>
constexpr int SUNphi::_posOfType ( ,
Tuple< Head, Tail... >   
)

Gets the position of a type in a tuple

Internal implementation, matching case

Check if T is of the same type of Head

Position in the nested list

Mark if present in the Tail

Definition at line 34 of file TupleOrder.hpp.

template<bool assertIfNotPresent, typename... T, typename TP >
auto SUNphi::_posOfTypes ( Tuple< T... >  t,
TP  tp 
) -> IntSeq<_posOfType<assertIfNotPresent>(T

Position of the types T in the Tuple TP, asserting or not.

Parameters
tHolds the types to be searched
tpTuple where to search

Definition at line 100 of file TupleOrder.hpp.

Variable Documentation

template<typename T , typename Tp >
constexpr int SUNphi::posOfType
Initial value:
=
_posOfType<ASSERT_IF_NOT_PRESENT>(T{},Tp{})
Tens< Tk, double > T
Tensor class of the expression.
Definition: RelBind.hpp:263

Gets the position of a type in a tuple or list, asserting if not present

Wraps the actual implementation

int a=posOfType<int,int,double,char>; //0
int b=posOfType<int,Tuple<int,double,char>>; //0
int c=posOfType<int,char,double,char>; //static_assert (not found)
int d=posOfType<int,int,int,char>; //static_assert (multiple occurency)

Definition at line 75 of file TupleOrder.hpp.

template<typename T , typename Tp >
constexpr int SUNphi::posOfTypeNotAsserting
Initial value:
=
_posOfType<DO_NOT_ASSERT_IF_NOT_PRESENT>(T{},Tp{})
Tens< Tk, double > T
Tensor class of the expression.
Definition: RelBind.hpp:263

Gets the position of a type in a tuple or list, not asserting if not present

Wraps the actual implementation

int a=posOfType<int,int,double,char>; //0
int b=posOfType<int,Tuple<int,double,char>>; //0
int c=posOfType<int,char,double,char>; //NOT_PRESENT
int d=posOfType<int,int,int,char>; //static_assert (multiple occurency)

Definition at line 91 of file TupleOrder.hpp.