How can one check if one parameter pack (interpreted as a set) is a subset of another one?
So far I only have the frame (using std::tuple), but no functionality.
Not exactly what you asked but... just for fun, using std::is_base_of you can create (in C++14, at least) a constexpr function that works like your struct.
The following is a working example (only C++14)
#include
#include
#include
template
struct foo : std::tuple...
{ };
template
bool isSubsetOf (std::tuple const &, std::tuple const &)
{
bool ret { true };
using un = int[];
using d2 = foo;
(void)un { (ret &= std::is_base_of, d2>::value, 0)... };
return ret;
}
int main()
{
using t1 = std::tuple;
using t2 = std::tuple;
using t3 = std::tuple;
std::cout << isSubsetOf(t1{}, t1{}) << std::endl; // print 1
std::cout << isSubsetOf(t1{}, t2{}) << std::endl; // print 1
std::cout << isSubsetOf(t2{}, t1{}) << std::endl; // print 1
std::cout << isSubsetOf(t1{}, t3{}) << std::endl; // print 1
std::cout << isSubsetOf(t3{}, t1{}) << std::endl; // print 0
}