I have an application where I am constructing tuple out of a parameter pack:
template<class... T>
struct foo {
typedef std::tuple<T...> A;
}
And I have another tuple-type B defined as:
typedef std::tuple<char, int> B;
Is there a way to obtain a new tuple C, such that C is a set subtraction of the types in the sets A and B at compile-time?
A = {int, double, float, bool}
B = {char, int}
C = A - B = {double, float, bool} // answer
Some more context to the complete problem:
template<class... T>
struct foo {
using first_type = typename std::tuple_element<0, // n'th type
std::tuple<T...>>::type;
}
I can do the above to find the 0th type, but I am interested in the first type that is not contained in set B above. So, somewhat like a compile-time search to find the first valid type.