Result of bitwise operator in C++
<p>Testing a couple of compilers (Comeau, g++) confirms that the result of a bitwise operator of some "integer type" is an int:</p>

<pre><code>void foo( unsigned char );
void foo( unsigned short );

unsigned char a, b;

foo (a | b);
</code></pre>

<p>I would have expected the type of "a | b" to be an unsigned char, as both operands are unsigned char, but the compilers say that the result is an int, and the call to foo() is ambiguous.  Why is the language designed so that the result is an int, or is this implementation dependent?</p>

<p>Thanks,</p>
