I have a lambda function as below, it explicitly declares int as its return type, but in its realization, it does nothing. Besides, it prints out its return value. To my surprise, it compiles without error and returns 1. Who knows the reason?
auto lambda = [](int a) -> int{};
cout << lambda << endl;
Aucun commentaire:
Enregistrer un commentaire