equals assignment

Michiel Helvensteijn nomail at please.com
Fri Apr 27 15:50:23 PDT 2007


renoX wrote:

> Another solution is the gcc hack of making the compiler warn on any =
> inside a 'if' except when there is a (( )), it's a hack but it's a more
> complete solution..

When should an assignment be used as part of an expression anyway? It's only
a way to make code more compact and less readable.

Maybe an assignment just shouldn't return anything.

I think the compiler should still be able to implicitly cast int to bool,
though.

-- 
Michiel




More information about the Digitalmars-d mailing list