//neccessary headfiles are included
int main(){
auto f=[](int x,int y){return x>y;};
auto f2=&f;
set<int,decltype(f2)> tree(f2);
for(auto elem:tree){cout<<elem<<endl;}
return 0;
}
what is the wrong with my code?
can we use lambda to initialize set/map?If yes,how to?If not,why can we do that when initializing set by function pointer is ok?