title: Why are 'constexpr' parameters not allowed?
body: <p>It would be useful to have 'constexpr' parameters in order to distinguish compiler-known values and so be able to detect errors at compile time. Examples:</p>
  <pre><code>int do_something(constexpr int x)
  {
    static_assert(x &gt; 0, &quot;x must be &gt; 0&quot;);
    return x + 5;
  }
  
  int do_something(int x)
  {
    if(x &gt; 0) { cout &lt;&lt; &quot;x must be &gt; 0&quot; &lt;&lt; endl; exit(-1); }
    return x + 5;
  }
  
  int var;
  
  do_something(9); //instance 'do_something(constexpr int x)' and check arg validity at compile time
  
  do_something(0); //produces compiler error
  
  do_something(var); //instance 'do_something(int x)'
  </code></pre>
  <p>This is invalid code for now. Can somebody explain to me why this can't be implemented?</p>
  <p>EDIT:</p>
  <p>Using templates users have to always pass literals as template arguments and not as function ones which is very uncomfortable:</p>
  <pre><code>template&lt;int x&gt;
  int do_something()
  {
    static_assert(x &gt; 0, &quot;x must be &gt; 0&quot;);
    return x + 5;
  }
  
  int do_something(int x)
  {
    if(x &gt; 0) { cout &lt;&lt; &quot;x must be &gt; 0&quot; &lt;&lt; endl; exit(-1); }
    return x + 5;
  }
  
  int var;
  
  do_something(9); //instance 'do_something(int x)' and doesn't check validity at compile time
  
  do_something(0); //same as above, if check was performed - compiler error should occur
  
  do_something&lt;9&gt;(); //instance template 'do_something&lt;int&gt;()'
  
  do_something&lt;0&gt;(); //produces compiler error
  
  do_something(var); //instance 'do_something(int x)'
  </code></pre>