title: Two versions of the same function (for inlining or constexpr)
body: <p>For <code>constexpr</code> functions the only option is to have recursive functions for anything but simple things.  The problem with that is that recursive functions are expensive at run time (especially if you are going to be calling yourself a lot of times).</p>
  
  <p>So is it possible to implement 2 functions one for <code>constexpr</code> and the other for normal use:</p>
  
  <pre><code>constexpr int fact(int x){  //Use this at compile time
    return x == 0 ? 1 : fact(x-1)*x;
  }
  
  int fact(int x){  //Use this for real calls
    int ret = 1;
    for (int i = 1; i &lt; x+1; i++){
      ret *= i;
    }
    return ret;
  }
  </code></pre>
  
  <p>And along the same lines can you make a special function for inline situations also?</p>