Here's a more concrete example:
class HttpClient
{
public:
void GetWebPage(const std::string &url, std::function<void(const std::string &)> callback);
};
HttpClient client;
client.GetWebPage("http://www.wholetomato.com/", [](const std::string &result){
// this gets called asynchronously:
std::cout << result;
});
Here it's pretty simple, but I'm using templated classes and smart pointers, and spelling out the lambda signature becomes more tedious.
And you're right, the std::function does not necessarily have to be filled by a lambda function but it is a common pattern. So I thought it might be suggested as soon as the [ is typed, or as a smart suggestion after entering the comma.