我正在尝试使用 lambdas 在我的函数参数中组合多个步骤。我努力了:
void testLambda(const char* input, const char* output = [](const char* word){return word;}(input)){
std::cout << input << " " << output << std::endl;
}
这个函数应该:如果
testLambda("hallo");
被调用,从第一个参数中获取并创建第二个参数(默认)并打印出来hallo hallo
。我怎样才能使这项工作?