Andrei Alexandrescu wrote: > If x is a complex expression and part of a complex control flow, it > becomes highly difficult what it means "at the beginning of the > function". It also becomes difficult to find a way to distinguish good > cases from bad cases without being overly conservative.
It looks like a more or less straightforward AST transformation to me. in { } body { F(); } out { G(old(x)); } => { auto old_x = x; try { F(); } finally { G(old_x); } } Repeat for each instance of 'old', in order of appearance. OK, it's not entirely trivial, but it's not prohibitively difficult either. -- Rainer Deyke - rain...@eldwood.com