To be honest, the only use case for this idiom I (or my colleagues) ever came across is the one you mentioned in the post. Expressions with side effects are generally discouraged, so I think we do well enough in this case.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Why I can't apply value inside while loop? | 14 | 21299 | April 14, 2025 | |
|
Some feedback
|
8 | 2900 | August 14, 2012 | |
| Conditional assignment operator proposal | 44 | 7846 | June 19, 2020 | |
| Nullable assigner? | 20 | 9754 | February 7, 2021 | |
| Feature request: Use infix *if* operator to emphasize non-local control transfer | 28 | 2632 | August 9, 2019 |