小编Spe*_*ber的帖子

Operatrator []作为非静态函数

码:

SchedulingItem operator[](Schedule obj,int el){
    return obj.OfVector().at(el);
}
Run Code Online (Sandbox Code Playgroud)

错误:

academia::SchedulingItem academia::operator[](academia::Schedule, int)' must be a nonstatic member function
     SchedulingItem operator[](Schedule obj,int el)

问题出在哪儿?

c++ operator-overloading

0
推荐指数
1
解决办法
67
查看次数

标签 统计

c++ ×1

operator-overloading ×1