'std::is_pointer of dereferenced double pointer [duplicate]

I have some code where i want to check for (accidental) double pointers in static_assert

#include<type_traits>


int main()
{
    using namespace std;
    float* arr[10];
    float ** pp;

    static_assert(!is_pointer<decltype(*arr)>::value, "double pointer detected");
    static_assert(!is_pointer<decltype(*pp)>::value, "double pointer detected");

}

I am curious why this compiles, as i was expecting the static_asserts to give an error.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source