No, that doesn't work because the user of foreach believes the elements in the range get changed but in fact only a temporary does. In contrast, the original version would fail to compile if it used a lambda such as `(ref x => ++x)`.

The fact that `ref` in foreach binds to rvalues is a bug in the design of D.