std::function<int(int)> f = [&](int c)->int{ --c; //call function //print function address static_cast<void*>(&f) return c <= 0 ? 0 : f(c); }; f(2);