Benefit of constexpr on non-changing expressions : <p>So I understand that the use of <code>constexpr</code> in C++ is for defined expressions that are be evaluated at compile time, and more obviously to declare a variable or function as a constant expression. My confusion comes from understanding any benefits of using it for simple functions that will not change.</p>

<p>Suppose you have a function to simply square a value...</p>

<pre><code>int square(int x) {
    return x * x;
}
</code></pre>

<p>Typically that will never change, or be overridden, however, I've seen people say that it would be better practice to instead define it as...</p>

<pre><code>constexpr int square(int x) {
    return x * x;
}
</code></pre>

<p>To me, this seems like such a trivial change. Can anyone enlighten me on serious advantages of declaring such simple expressions as <code>constexpr</code>?</p>
