The following syntax is valid:
while (int i = get_data())
{
}
But the following is not:
do
{
} while (int i = get_data());
Add this
#define do(cond) switch (cond) do default:
at the beginning of your code.
Now, you can write
do (int i = get_data())
{
// your code
} while ((i = get_data()));
It is important that this #define
does not break the original syntax of the do
keyword in do-while loop.
However, I admit that it is obscure.