C++11 lambda in decltype

后端 未结 3 2101
孤城傲影
孤城傲影 2020-12-14 15:53

For the following code:

auto F(int count) -> decltype([](int m) { return 0; }) 
{                                                               
    retur         


        
3条回答
  •  执笔经年
    2020-12-14 16:16

    With C++14, you can now simply omit the return type:

    auto F(int count)
    {
        return [](int m) { return 0; };
    }
    

提交回复
热议问题