I'm just learning metaprogramming in C++. I want to make auto detector of opengl type id based on passed type. My code passes decltype(array) which becomes float*. If I use GLType<float>::type it works fine, but GLType<float*>::type fails with "unknown member type" error. I thought std::is_same_v<std::decay_t<T>, float>> will evaluate to true_type on any float*, float[], const float, etc.. as stated here
template <typename T, typename = void>
struct GLType {};
template <typename T>
struct GLType<T, std::enable_if_t<std::is_same_v<std::decay_t<T>, float>>> {
const static constexpr int type = GL_FLOAT;
};
template <typename T>
struct GLType<T, std::enable_if_t<std::is_same_v<std::decay_t<T>, double>>> {
const static constexpr int type = GL_DOUBLE;
};