title: Why can't I use a constexpr pointer as template parameter in C++11?
body: <p>Please consider the following code:</p>
  
  <pre><code>template &lt;typename T, typename P, T P:: *s&gt; struct H {};
  
  struct AA { int i; };
  
  int main()
  {
    typedef int AA::*PI;
    constexpr PI pi = &amp;AA::i;
  
    H&lt;int, AA, &amp;AA::i&gt; h1;    // OK
    // H&lt;int, AA, pi&gt; h2;     // compile error
  }
  </code></pre>
  
  <p>I have member pointer <code>pi</code> pointing to <code>AA::i</code>.
  <code>pi</code> is a <code>constexpr</code> variable. Why can't I use it as a template parameter, even though using <code>&amp;AA::i</code> directly works?</p>