Or in C++23:
auto calc = [](this auto &calc, int x) -> int {/*...*/};
return calc(x);
.