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.
is_subset_of
version of an answer from your previous question:
#include
#include
template
struct tag { };
template
struct is_subset_of_helper: tag... { };
template
struct is_subset_of: std::false_type { };
template
struct bool_pack { };
template
using my_and = std::is_same, bool_pack>;
template
struct is_subset_of, std::tuple, typename std::enable_if< my_and< std::is_base_of, is_subset_of_helper>::value... >::value >::type >:
std::true_type { };
int main() {
using t1 = std::tuple;
using t2 = std::tuple;
using t3 = std::tuple;
static_assert(is_subset_of::value, "err");
static_assert(is_subset_of::value, "err");
static_assert(is_subset_of::value, "err");
static_assert(is_subset_of::value, "err");
static_assert(!is_subset_of::value, "err");
}
[live demo]