title: Is initializing a reference of type "int &" (not const-qualified) with a value of type "bool" some hack?
body: <p>I came accros this c++ code <a href="http://www.cplusplus.com/forum/articles/3638/" rel="nofollow">here</a>: </p>
  
  <pre><code>  // round alternate
    // Bias: none for sequential calls
    bool _is_up = false;
    template &lt;typename FloatType&gt;
    FloatType roundalternate( const FloatType&amp; value, int&amp; is_up = _is_up )
      {
      if ((is_up != is_up))
        return roundhalfup( value );
      return roundhalfdown( value );
      }
  </code></pre>
  
  <p>And it confuses me, how is this supposed to work? How is this supposed to make an alternate call on each call of this function?</p>
  
  <p>Is this code just plain wrong, or is it supposed to work due to some compiler weirdness?
  It seems to have compiled fine with g++ but I can't reproduce this at the moment.
  icc is not accepting it:</p>
  
  <pre><code>rounding.h(183): error: a reference of type "int &amp;" (not const-qualified) cannot be initialized with a value of type "bool"
  FloatType roundalternate0( const FloatType&amp; value, int&amp; is_up = _is_up )
                                                                    ^
  </code></pre>
  
  <p><strong>Update</strong>
  g++ does not seem to accept it either (update to clarify after Ben Voight's answer: g++ can compile the plain file (which icc can not), but fails if you try to invoke without a second argument)</p>
  
  <pre><code>bla.h: In function ‘FloatType rounding::roundalternate(const FloatType&amp;, int&amp;) [with FloatType = char*]’:
  bla.h:220:35: error: could not convert ‘rounding::_is_up’ from ‘bool’ to ‘int&amp;’
     rounding::roundalternate(argv[0])
  </code></pre>
  
  <p><a href="https://groups.google.com/forum/#!msg/tuxedo-tools-users/-b2VUqRlRSc/S3Tf9wzJ3XAJ" rel="nofollow">Other people</a> are reporting problems with clang as well</p>
  
  <p>Relevance: I'm trying to compile <a href="http://cufflinks.cbcb.umd.edu/" rel="nofollow">cufflinks</a> with the intel compiler, and it is failing because this code is in there.</p>
  
  <p>I have no idea how cufflinks could have compiled before with this in it.</p>
  
  <p>update2:
  Cufflinks compiled fine with g++, not with icc, I've contacted the maintainers, and they have removed the offending piece of code in newer versions.</p>