title: C++ switch statement expression evaluation guarantee
body: <p>Regarding switch the standard states the following. <em>"When the switch statement is executed, its condition is evaluated and compared with each case constant."</em></p>
  
  <p>Does it mean that the condition expression evaluated once and once only, and it is guaranteed by the standard for each compiler?</p>
  
  <p>For example, when a function is used in the switch statement head, with a side effect.</p>
  
  <pre><code>int f() { ... }
  switch (f())
  {
      case ...;
      case ...;
  }
  </code></pre>