On 12/24/2011 04:33 AM, Don wrote:
On 24.12.2011 02:30, Derek wrote:
On Sat, 24 Dec 2011 09:19:26 +1100, bearophile
<[email protected]> wrote:
This is why it's better to avoid casts, not requiring them in the
first place, unless they are useful. In this case I think a cast
introduces more danger than the risks caused by implicit bool->int
conversions.
If we assume that explicit casts are required for bool->int conversion,
can you show some code in which this could cause a problem?
I think stuff like
int z += x > y;
should ideally require a cast. That's a crazy operation.
Love that one...
Andrei