将std :: function作为参数传递给lambda

时间:2017-11-01 13:31:46

标签: c++ c++11 visual-studio-2012 lambda

如何在函数lambda参数中执行代码?

auto lambda = [] (std::function<void(std::string,std::string)>) { //run function, work with string parameters };

std::function<void(std::string, std::string)> work = [](std::string, std::string) {};

lambda(work);

0 个答案:

没有答案