SUNphi
1.0
|
Define Tuple. More...
Go to the source code of this file.
Classes | |
struct | SUNphi::_isTuple< T > |
struct | SUNphi::_isTuple< Tuple< Tp... > > |
struct | SUNphi::ConstrainIsTuple< T > |
Constrain the class T to be a Tuple. More... | |
struct | SUNphi::ConstrainTupleTypesAreAllDifferent< T, class > |
Constrain all types in the tuple to be different. More... | |
struct | SUNphi::ConstrainTupleHasType< T, TP, class > |
Constrain a type T to be contained in a Tuple . More... | |
struct | SUNphi::ConstrainTupleHasNotType< T, TP, class > |
Constrain a type T to be not contained in a Tuple . More... | |
Macros | |
#define | STATIC_ASSERT_IS_TUPLE(T) static_assert(isTuple<T>,"Type is not a tuple") |
Assert if the type is not a Tuple. | |
#define | DEFINE_VARIADIC_TYPE_FROM_TUPLE(TYPE) |
#define | STATIC_ASSERT_TUPLE_TYPES_ARE_ALL_DIFFERENT(T) static_assert(tupleTypesAreAllDifferent<T>,"Types in the tuple are not all different") |
Assert if the Tuple contains multiple times a given type. | |
#define | STATIC_ASSERT_TUPLE_HAS_TYPE(T, TP) static_assert(tupleHasType<T,TP>,"Searched type not found") |
Assert if the type T is not in the types of tuple TP . | |
#define | STATIC_ASSERT_TUPLE_HAS_NOT_TYPE(T, TP) static_assert(not tupleHasType<T,TP>,"Searched type found") |
Assert if the type T is in the types of tuple TP . | |
Typedefs | |
template<class... Tp> | |
using | SUNphi::Tuple = std::tuple< Tp... > |
template<int I, typename Tp , typename = EnableIf<isTuple<Tp>>> | |
using | SUNphi::TupleElementType = typename std::tuple_element< I, Tp >::type |
Returns the type of the element I of the Tuple Tp. | |
Functions | |
template<typename T , typename... Tp> | |
constexpr bool | SUNphi::_tupleHasType (T, Tuple< Tp... >) |
template<typename... ToBeSearchedTypes, typename... ContainingTypes> | |
constexpr bool | SUNphi::_tupleHasTypes (Tuple< ToBeSearchedTypes... >, Tuple< ContainingTypes... >) |
Variables | |
template<class T > | |
constexpr int | SUNphi::isTuple |
template<typename T > | |
constexpr int | SUNphi::tupleSize |
Total number of elements in a Tuple . More... | |
template<class T1 , class T2 , class = FalseType> | |
static constexpr int | SUNphi::_nOfTypeInTuple |
template<class T , class... Tp> | |
static constexpr int | SUNphi::_nOfTypeInTuple< T, Tuple< Tp... > > |
template<class T , class TP , class = ConstrainIsTuple<TP>> | |
static constexpr int | SUNphi::nOfTypeInTuple |
template<class T , class = ConstrainIsTuple<T>> | |
static constexpr int | SUNphi::nDiffTypesInTuple |
template<class... Tp> | |
static constexpr int | SUNphi::nDiffTypesInTuple< Tuple< Tp... > > |
template<class T , class = ConstrainIsTuple<T>> | |
static constexpr bool | SUNphi::tupleTypesAreAllDifferent |
Check whether all types of a Tuple are different. More... | |
template<typename T , typename Tp , typename = ConstrainIsTuple<Tp>> | |
constexpr bool | SUNphi::tupleHasType |
Return true if Tuple Tp contains the type T. More... | |
template<typename TpToSearch , typename TpContaining > | |
constexpr bool | SUNphi::tupleHasTypes |
Define Tuple.
Definition in file TupleClass.hpp.
#define DEFINE_VARIADIC_TYPE_FROM_TUPLE | ( | TYPE | ) |
Define a Variadic type taking all types of a tuple
as list of parameters
Example:
Definition at line 94 of file TupleClass.hpp.
using SUNphi::Tuple = typedef std::tuple<Tp...> |
Define Tuple, a list of arbitrary types.
Directly aliasing the std library.
Definition at line 20 of file TupleClass.hpp.
constexpr bool SUNphi::_tupleHasType | ( | T | , |
Tuple< Tp... > | |||
) |
Return true if Tuple
Tp contains the type T
Internal implementation
Definition at line 196 of file TupleClass.hpp.
constexpr bool SUNphi::_tupleHasTypes | ( | Tuple< ToBeSearchedTypes... > | , |
Tuple< ContainingTypes... > | |||
) |
Checks that a tuple is contained into another one
Internal implementation
Definition at line 244 of file TupleClass.hpp.
|
static |
Counts the same types
Single pair of types case - forbids implementation
Definition at line 130 of file TupleClass.hpp.
|
static |
Counts the same type
Counts the occurrency of type T inside a tuple
Definition at line 138 of file TupleClass.hpp.
constexpr int SUNphi::isTuple |
Check that a type is a tuple
Gives visibility to the internal implementation
Definition at line 45 of file TupleClass.hpp.
|
static |
Count the number of different types in a Tuple
Generic type - forbids instantiation
Definition at line 159 of file TupleClass.hpp.
|
static |
Count the number of different types in a Tuple
Real tuple case
Definition at line 166 of file TupleClass.hpp.
|
static |
Counts the same type
Gives external visibility to the implementation
Definition at line 148 of file TupleClass.hpp.
constexpr bool SUNphi::tupleHasType |
Return true if Tuple
Tp contains the type T.
Definition at line 207 of file TupleClass.hpp.
constexpr bool SUNphi::tupleHasTypes |
Checks that a tuple is contained into another one
Gives visibility to the internal implementation
Definition at line 256 of file TupleClass.hpp.
constexpr int SUNphi::tupleSize |
Total number of elements in a Tuple
.
Definition at line 73 of file TupleClass.hpp.
|
static |
Check whether all types of a Tuple
are different.
Definition at line 175 of file TupleClass.hpp.