Member function call in decltype

前端 未结 6 1066
北荒
北荒 2021-02-05 09:23

The following code:

struct A
{
    int f(int);
    auto g(int x) -> decltype(f(x));
};

Fails to compile with the error:

erro         


        
6条回答
  •  无人及你
    2021-02-05 09:44

    Currently you can only access 'this' and members of the class inside the function body, but this is likely to be changed soon:

    http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1207

提交回复
热议问题