Of course the assertion fails. You're requiring that the type T
is a pointer, but T
here is an int
.
Perhaps you meant the following?
// Ensure that `T` is not a pointer
static_assert(!std::is_pointer<T>::value, "no operator overloaded for pointers");
Assertions are statements that ensure a particular condition. It's not quite "if X then output error message Y"; in fact, it's the exact opposite. :)