title: Whyever **not** declare a function to be `constexpr`?
body: <p>Any function that consists of a return statement only could be declared
  <code>constexpr</code> and thus will allow to be evaluated at compile time if all
  arguments are <code>constexpr</code> and only <code>constexpr</code> functions are called in its body. <strong>Is there any reason not to declare <em>any</em> such function <code>constexpr</code> ?</strong></p>
  
  <p>Example:</p>
  
  <pre><code>  constexpr int sum(int x, int y) { return x + y; }
    constexpr i = 10;
    static_assert(sum(i, 13) == 23, "sum correct");
  </code></pre>
  
  <p><strong>Could anyone provide an example where declaring a function <code>constexpr</code>
  would do any harm?</strong></p>
  
  <hr>
  
  <p>Some initial thoughts:</p>
  
  <p>Even if there should be no good reason for ever declaring a function 
  not <code>constexpr</code> I could imagine that the <code>constexpr</code> keyword has a 
  transitional role: its absence in code that does not need compile-time
  evaluations would allow compilers that do not implement compile-time 
  evaluations still to compile that code (but to fail reliably on code 
  that needs them as made explict by using <code>constexpr</code>).</p>
  
  <p>But what I do not understand: if there should be no good reason for 
  ever declaring a function not <code>constexpr</code>, why is not <strong>every</strong> function
  in the standard library declared <code>constexpr</code>? (You cannot argue
  that it is not done yet because there was not sufficient time yet to
  do it, because doing it for <em>all</em> is a no-brainer -- contrary to deciding for every single function if to make it <code>constexpr</code> or not.)
  --- I am aware that <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2976.html" rel="noreferrer">N2976</a>
  deliberately not requires cstrs for many standard library types such
  as the containers as this would be too limitating for possible 
  implementations. Lets exclude them from the argument and just wonder:
  once a type in the standard library actually has a <code>constexpr</code> cstr, why is not every function operating on it declared <code>constexpr</code>?</p>
  
  <p>In most cases you also cannot argue that you may prefer not to declare a function <code>constexpr</code> simply because you do not envisage any compile-time usage: because if others evtl. will use your code, they may see such a use that you do not. (But granted for type trait types and stuff alike, of course.)</p>
  
  <p>So I guess there must be a good reason and a good example for deliberately not declaring a function <code>constexpr</code>?</p>
  
  <p>(with "every function" I always mean: every function that meets the 
  requirements for being <code>constexpr</code>, i.e., is defined as a single 
  return statement, takes only arguments of types with constexpr 
  cstrs and calls only <code>constexpr</code> functions. Since C++14, <a href="https://en.cppreference.com/w/cpp/language/constexpr" rel="noreferrer">much more is allowed in the body of such function</a>: e.g., <em>C++14 constexpr functions may use local variables and loops</em>, so an even wider class of functions could be declared <code>constexpr</code>.) </p>
  
  <p>The question <a href="https://stackoverflow.com/questions/5098069/why-discards-stdforward-constexpr-ness">Why does <code>std::forward</code> discard <code>constexpr</code>-ness?</a> is a special case of this one.</p>