title: SFINAE and decay don't work together. Why?
body: <p>I'm just learning metaprogramming in C++. I want to make auto detector of opengl type id based on passed type. My code passes <code>decltype(array)</code> which becomes <code>float*</code>. If I use <code>GLType&lt;float&gt;::type</code> it works fine, but <code>GLType&lt;float*&gt;::type</code> fails with &quot;unknown member type&quot; error. I thought <code>std::is_same_v&lt;std::decay_t&lt;T&gt;, float&gt;&gt;</code> will evaluate to <code>true_type</code> on any <code>float*, float[], const float, etc..</code> as stated <a href="https://en.cppreference.com/w/cpp/types/decay" rel="nofollow noreferrer">here</a></p>
  <pre><code>template &lt;typename T, typename = void&gt;
  struct GLType {};
  
  template &lt;typename T&gt;
  struct GLType&lt;T, std::enable_if_t&lt;std::is_same_v&lt;std::decay_t&lt;T&gt;, float&gt;&gt;&gt; {
      const static constexpr int type = GL_FLOAT;
  };
  
  template &lt;typename T&gt;
  struct GLType&lt;T, std::enable_if_t&lt;std::is_same_v&lt;std::decay_t&lt;T&gt;, double&gt;&gt;&gt; {
      const static constexpr int type = GL_DOUBLE;
  };
  </code></pre>