I am trying to use catch2 TEMPLATE_TEST_CASE for pairs of types, i.e. instead of templating a single type for each test, I need to use a correlated pair of types. I thought I could use std::variant
to store these pairs, but compilation fails with: error: expected primary-expression before ‘)’ token. auto outtype = std::get<0>(TestType);
.
I'd appreciate any help for the reason of this error or an alternative solution to this problem. Here is the code snippet:
using varA = std::variant<OutputA, InputA>;
using varB = std::variant<OutputB, InputB>;
TEMPLATE_TEST_CASE("test", "[test][template]", varA, varB) {
auto outtype = std::get<0>(TestType);
auto intype = std::get<1>(TestType);
}