我正在为学校的游戏写一个缓存。其思想是,这个缓存存储网格、材料等,并将驱动器上的位置作为键使用,因此它们只需要加载一次,然后就可以通过插入它们的相同命令从缓存中检索。我遇到的问题似乎是,除了构造函数之外,我不能在任何地方向缓存添加项。)提供了以下错误:和
"binary '[': no operator</e
template <class T>public: bool operator== (const T b) { return this->IsEqual(b); } //Both are implemented in cpp file
bool operator!bool IsEqual(const Dimentions b) { //IsEqual
A(int i = 25) {x = i;y=new int[i];for(int j=0;j<i;j++) y[j]=j;} int& operatorinitialization of reference of type int& from expression of type const int"我理解它,因为它返回对函数声明为const的东西的非但是,对于超载,它的行为不应该是一样的</e