(1)class type's override member method
template <class R>
class XList: public DList<R> {
public:
XList(int dFlag=1):DList<R>(dFlag) {
}
const R & operator [](int n) const {
const DList<R> &r=(*this);
return r[n];
}
};
XList's base class define override operator <<
template <class R>
class DList
{ // bidirection linked list
private:
int _len, _curIndex;
Node<R> * current;
protected:
int _delFlag;
Node<R> * head;
Node<R> * tail;
public:
DList<R>& operator <<(DList<R>&list);
//...
};
code sample;
XList<int> arItems;
arItems<<m_arItems; //merge
when click on << operator on above line,press Alt+G,I cann't get anything for navigation.
In this case,it's reasonable to search the class(and base class)declare and if has override operator,then supply it.Even though the implementation is not suppied or invisible(i.e.in binary lib file),still supply the .h file path for navigation to indicate the programer has intent to supply this operator himself rather than nothing.
(2)for global or non-member override operator,if available,can be searched and supplied as navigation.
//.h file
class A1{
public:
A1(int val=0):m_nVal(val){}
public:
int m_nVal;
};
class B1{
public:
B1(double val=0):m_dVal(val){}
public:
double m_dVal;
};
double operator*(const A1&a,const B1&b){
return a.m_nVal*b.m_dVal;
}
//code sample:
A1 a(3);
B1 b(2);
double dRes=a*b;
when click on * and Alt+G,it should navigate to operator*().