Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Improvement on navigation to operator method

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
jzq740176597 Posted - Nov 23 2011 : 02:22:53 AM
(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*().
7   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Nov 29 2011 : 3:43:47 PM
The alt-g on operator problem, I have the code, thank you for this. I am seeing the problem now, I had missed the fact you were using a non member operator*() function. I had been testing a class member operator*() function:

case=63029

The problem with the listbox icon, I am now seeing the same thing. I believe this is covered by:

case=38235
jzq740176597 Posted - Nov 28 2011 : 11:37:15 PM
My version 1856.VC6.WinXP sp3
I have sended a e-mail to Whole Tomato Support <[email protected]>.
it cantaines a new Win32 App in new workspace.You can test Problem 2..

Problem 1 I have found the point,because the declare and the invoked code all in one cpp file.

quote:
When alt-g on operator+() is failing for you, where have you put the caret? Before of after the "+" ?

I am sure I have put caret in the correct place.I think perhaps the version your VA or VC do some matter leading you cann't reproduce the problem.
feline Posted - Nov 28 2011 : 12:53:13 PM
Problem 1, I still cannot reproduce the wrong icon in the listbox. I don't know if having the code all in one file matters or not. Since I cannot reproduce the problem, there must be another factor I don't know about, but I don't know what that factor is. All I can do is make educated guesses, and try to work out what the difference is.

Can you reproduce this problem by placing the code into a new, default workspace?


Problem 2, Alt-g is working for me on a number of overloaded operators, including:

operator==(), operator!=(), operator+=(), operator-=(), operator+(), operator-()

When alt-g on operator+() is failing for you, where have you put the caret? Before of after the "+" ?
jzq740176597 Posted - Nov 24 2011 : 8:34:01 PM
(1)
quote:
So far I cannot reproduce your problem with the wrong icon on the listbox. Is all of the code in the same file?

yes!the class declare and implementation is all in the same file,And when move the declare to other file,it's correct!
Is this a known bug? and it's possible to fix in the future?why the code in the same file will do much matter?could you tell me some ones?
(2)
quote:
Alt-g not working on operator<< is a known bug:

the bug will be fixed in next version? And I have a test on member operator +(),Alt+G also doesn't work.So operator<< is not a special case! Navigate to all kind of operators whether is class-member or not all haven't been supported?
feline Posted - Nov 24 2011 : 5:39:58 PM
Sometimes it takes 2 or 3 days for questions to be replied to, especially since we are often in different time zones to you, so please be patient.


Alt-g not working on operator<< is a known bug:

case=1229

So far I cannot reproduce your problem with the wrong icon on the listbox. Is all of the code in the same file? If you restart the IDE can you still reproduce this problem?
jzq740176597 Posted - Nov 23 2011 : 9:11:09 PM
Any one can answer me?
jzq740176597 Posted - Nov 23 2011 : 02:34:04 AM
Another trivial problem found in the above sample:
//.h file
class A1{
public:
	A1(int val=0):m_nVal(val){}
public:
	int m_nVal;
};

//code
	A1   a(3);
	B1  b(2);
         a.*
	double dRes=a*b;

when type a. appear:




the m_nVal's icon is for public method not member-data.
(I guarantee the A1 and B1 is unique!)

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000