C ++ 17使用此运算符的类成员的结构化绑定

时间:2018-01-07 14:55:45

标签: c++ this c++17 class-members structured-bindings

为什么C ++ 17结构化绑定不像this->运算符那样是这样的语法:

std::tuple<int, std:string> external_function()
{
    return { 0, "" };
}

class Foo
{
public:
    void internal_method()
    {
        auto [this->x, unused] = external_function();
    }

private:
    int x;
};

如何将类成员说明符添加到返回的变量名中?

0 个答案:

没有答案