阅读背景:

如何定义方括号操作符的setter ?

来源:互联网 

Lets say I have this class:

假设我有这门课:

struct testy {
    std::array<int, 10> data;
    float operator[] (int idx) const        { return 1 / data[idx]; }
    float &operator[](int idx)              { return ??? }
};
struct



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: