You could do it like this:
#include
template
struct unique_types;
template
struct unique_types
: unique_types, unique_types, unique_types {};
template
struct unique_types
{
static_assert(!std::is_same::value, "Types must be unique");
};
int main()
{
// OK.
unique_types foo;
// Should not compile.
unique_types bar;
}