Let's say we have two types
using t1 = int*; using t2 = int*;
I know that std::is_same<t1, t2>::value will give us true. And what is, or, is there a template tool to achieve the following?
tool<t1, t2>::value == false;
tool<t1, t1>::value == true;
I'd say it's probably impossible but I am not an expert in C++.
Presumably, this tool can be used in a template function as
using allowed = int*;
using not_allowed = int*;
template <class T>
void f(T var) {
static_assert(tool<T, allowed>::value &&
tool<T, not_allowed>::value == false, "");
}
Thanks!