#include <functional>
using namespace std;
struct A
{
int x;
};
function<int()> GetFunc()
{
A c = {0};
return [=]() mutable { return c.x++; };
}
int main()
{
auto x = GetFunc();
return x()+x()+x()-3;
}
I2luY2x1ZGUgPGZ1bmN0aW9uYWw+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpzdHJ1Y3QgQQp7CiAgICBpbnQgeDsKfTsKCmZ1bmN0aW9uPGludCgpPiBHZXRGdW5jKCkKewogICAgQSBjID0gezB9OwogICAgcmV0dXJuIFs9XSgpIG11dGFibGUgeyByZXR1cm4gYy54Kys7IH07Cn0KCmludCBtYWluKCkKewogICAgYXV0byB4ID0gR2V0RnVuYygpOwogICAgcmV0dXJuIHgoKSt4KCkreCgpLTM7Cn0=