You can just replace auto with int in this case, since the return type of the lambda is int.
The author's original intention might have been for ff to be a lambda. In that case, he should have omitted the call from line 15. That would make second code well-formed, as you can see here: http://coliru.stacked-crooked.com/a/bcefad00afebd000