title: C++11 - static_assert within constexpr function?
body: <p>How would one properly do a <code>static_assert</code> within a <code>constexpr</code> function?  For example:</p>
  
  <pre><code>constexpr int do_something(int x)
  {
    static_assert(x &gt; 0, "x must be &gt; 0");
    return x + 5;
  }
  </code></pre>
  
  <p>This is not valid C++11 code, because a constexpr function must only contain a return statement.  I don't think that the standard has an exception to this, although, the GCC 4.7 does not let me compile this code.</p>