title: constexpr condition not constant?
body: <p>I wrote the following C++17 code:</p>
  
  <pre><code>constexpr bool gDebug = true;
  
  template &lt;typename T&gt; constexpr const T&amp; Select(const bool pCondition, const T&amp; a, const T&amp; b)
  {
     if constexpr (pCondition)
     {
        return a;
     }
     else
     {
        return b;
     }
  }
  </code></pre>
  
  <p>Then I called it like this:</p>
  
  <pre><code>int c = Select&lt;QString&gt;(gDebug, a, b); // In .cpp
  </code></pre>
  
  <p>I get <code>error: ‘pCondition’ is not a constant expression</code> for the <code>if constexpr</code> line.</p>
  
  <p>Why? Shouldn't this work?</p>