Note that this approach is easily extensible to member functions. It's also more tedious to write than a local function would be, and clearly a workaround for a language limitation. But, in the end, it's not bad, and it demonstrates some of the power inherent in functors over plain functions. It was, as always, about setting a specific design problem, exploring alternative methods for solving it, and weighing the solutions to pick the best-engineered option. When designing your programs, strive for simplicity and elegance wherever possible.
Simpler designs are easier to code and test.
Avoid complex solutions, which are almost certain to be fragile and harder to understand and maintain. While being careful not to fall into the trap of overengineering, do recognize that even if coming up with a judicious simple design takes a little extra time up front, the long-term benefits usually make that time well spent.