我收到以下编译错误:
错误:从'const IntervalST '到'IntervalST '的无效转换[-fpermissive]
当我编译我的代码.代码很大但这里是相关部分:
IntervalST类:
template <class Key> class intervalST_const_iterator;
template <class Key> class IntervalST
{
private:
Interval<Key> *root;
//friend class intervalST_const_iterator<Key>;//allow the iterator class to access the private section of intervalST
bool isRed(Interval<Key> *interval);
Interval<Key> *rotateLeft(Interval<Key> *h);
Interval<Key> *rotateRight(Interval<Key> *h);
Interval<Key> *put(Interval<Key> *h,Key lo, Key hi, Key val);
Interval<Key> *moveRedLeft(Interval<Key> *h);
Interval<Key> *moveRedRight(Interval<Key> *h);
Interval<Key> *deleteMin(Interval<Key> *h, Key hi);
Interval<Key> *balance(Interval<Key> *h);
Interval<Key> *remove(Interval<Key> *h, Key lo, Key hi);
Interval<Key> *min(Interval<Key> *h);
Interval<Key> *addDuplicate(Interval<Key> *h, Key hi); …Run Code Online (Sandbox Code Playgroud)