TTS v3.0.0
The Tiny Test System
 
Loading...
Searching...
No Matches
tts::cartesian_product< L1, L2 > Struct Template Reference

Generate the Cartesian product of two type lists. More...

Detailed Description

template<typename L1, typename L2>
struct tts::cartesian_product< L1, L2 >

Generate the Cartesian product of two type lists.

Given two types lists L1 and L2, generate a new types list containing all possible combinations of types from L1 and L2 as a types<T1,T2> where T1 is from L1 and T2 is from L2.

Template Parameters
L1First types list
L2Second types list

Example

#define TTS_MAIN // No need for main()
#include <tts/tts.hpp>
TTS_CASE_TPL("Check types over cartesian product of types lists",
tts::types<char, short>>)<typename T, typename U>(
{
TTS_GREATER_EQUAL(sizeof(T), 4UL);
TTS_LESS_EQUAL(sizeof(U), 2UL);
};
#define TTS_LESS_EQUAL(LHS, RHS,...)
Performs less-or-equal-than comparison between two expressions.
Definition relation.hpp:218
#define TTS_GREATER_EQUAL(LHS, RHS,...)
Performs greater-or-equal-than comparison between two expressions.
Definition relation.hpp:239
#define TTS_CASE_TPL(ID,...)
Introduces a template test case and registers it into the current test driver.
Definition case.hpp:170
auto constexpr typename_
Evaluates to an object containing the name of the type T in readable form.
Definition typename.hpp:126
Generate the Cartesian product of two type lists.
Definition types.hpp:67
Encapsulates a single type into a reusable type object.
Definition types.hpp:112
Encapsulates a variadic list of types into a reusable object.
Definition types.hpp:25