title: check if member exists using enable_if
body: <p>Here's what I'm trying to do:</p>
  
  <pre><code>template &lt;typename T&gt; struct Model
  {
      vector&lt;T&gt; vertices ;
  
      #if T has a .normal member
      void transform( Matrix m )
      {
          each vertex in vertices
          {
            vertex.pos = m * vertex.pos ;
            vertex.normal = m * vertex.normal ;
          }
      }
      #endif
  
      #if T has NO .normal member
      void transform( Matrix m )
      {
          each vertex in vertices
          {
            vertex.pos = m * vertex.pos ;
          }
      }
      #endif
  } ;
  </code></pre>
  
  <p>I've seen <a href="https://stackoverflow.com/questions/11248173/enable-if-seems-to-work-outside-a-class-but-not-inside?rq=1">examples</a> of using <code>enable_if</code>, but I cannot understand how to apply <code>enable_if</code> to this problem, or if it even can be applied.</p>