title: Boolean multiplication in c++?
body: <p>Consider the following:</p>
  
  <pre><code>inline unsigned int f1(const unsigned int i, const bool b) {return b ? i : 0;}
  inline unsigned int f2(const unsigned int i, const bool b) {return b*i;}
  </code></pre>
  
  <p>The syntax of <code>f2</code> is more compact, but do the standard guarantees that <code>f1</code> and <code>f2</code> are strictly equivalent ?</p>
  
  <p>Furthermore, if I want the compiler to optimize this expression if <code>b</code> and <code>i</code> are known at compile-time, which version should I prefer ?</p>