Strange bracket-parentheses notation in C++, looking somewhat like a for each loop

后端 未结 3 1496
醉梦人生
醉梦人生 2021-01-22 08:33

So this is how the code looks:

auto generateHash = [](std::vector &files) -> std::shared_ptr {
    // Other code here
}
         


        
3条回答
  •  清酒与你
    2021-01-22 09:13

    This is lambda function, see e.g. http://en.cppreference.com/w/cpp/language/lambda.

提交回复
热议问题