How to workaround assignment not allowed in a condition?

Steven Schveighoffer schveiguy at gmail.com
Wed Oct 12 13:37:15 UTC 2022


On 10/12/22 9:17 AM, Rene Zwanenburg wrote:
> On Wednesday, 12 October 2022 at 02:15:55 UTC, Steven Schveighoffer wrote:
>> Am I missing something?
> 
> Perhaps I am, but why not turn it into a numeric comparison, like:
> 
> ```
> while((i = 5) == 0)
> ```

Yes, that is the answer, that was eluding me.

What blinded me from it is that the original was `while(!(i = 5))`, and 
I couldn't see past that `!` operator.

-Steve


More information about the Digitalmars-d-learn mailing list