Use of std::function in c++
Is there any difference between normal function
#include<bits/stdc++.h> using namespace std; int square(int a) { return a*a; } int main() { cout<<square(5); return 0; }
and a function created using std::function
#include<bits/stdc++.h> using namespace std; int main() { function<int(int)> square=[&](int a){ return a*a; }; cout<<square(5); return 0; }
2023 ICPC Asia West Continent Final Contest (live commentary)