equals assignment
Dan
murpsoft at hotmail.com
Fri Apr 27 16:08:45 PDT 2007
Heehee... today I retired from my job.
On thursday I'm going to a tropical island. That said...
I think the real solution is to just use the right operator, and recognize the difference between = and ==, just like you know to put a semicolon at the end. It's trivial.
Worry about metaprogramming or 'in' operator for normal arrays, proveability or something. : p
Michiel Helvensteijn Wrote:
> 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