I have an overloaded operator&
for my class where I do a static assert if the parameter is a pointer.
class test {
public:
template<typename T>
friend inline test& operator&(test& so, T const& t) {
std::cout << "is_pointer : " << std::is_pointer<T>::value << std::endl;
static_assert(std::is_pointer<T>::value, "no operator overloaded for pointers.");
// some stuff
}
};
If I use this operator I always get the assertion even if the type is definitively not a pointer. std::cout << "is_pointer : " << std::is_pointer<T>::value << std::endl;
is printing a zero...
int main() {
test t;
t & 123;
return 0;
}