C++14 using auto keyword in a method's definition

后端 未结 3 1177
不思量自难忘°
不思量自难忘° 2021-02-19 18:46

I have several std::unordered_maps. They all have an std::string as their key and their data differs. I want to make a csv string from a given map\'s k

3条回答
  •  轮回少年
    2021-02-19 19:33

    auto parameters are only allowed in lambdas in C++14.

    Probably this is since in an classic function like yours you could have declared a function template (which is basically what happens in the lambda case) while lambdas can't be templates.

提交回复
热议问题