Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Improvement on navigation to operator method
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jzq740176597
Tomato Guru

China
343 Posts

Posted - Nov 23 2011 :  02:22:53 AM  Show Profile  Reply with Quote
(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*().

Creation come from persist!

Edited by - jzq740176597 on Nov 23 2011 8:29:43 PM

jzq740176597
Tomato Guru

China
343 Posts

Posted - Nov 23 2011 :  02:34:04 AM  Show Profile  Reply with Quote
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!)
Go to Top of Page

jzq740176597
Tomato Guru

China
343 Posts

Posted - Nov 23 2011 :  9:11:09 PM  Show Profile  Reply with Quote
Any one can answer me?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Nov 24 2011 :  5:39:58 PM  Show Profile  Reply with Quote
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?

zen is the art of being at one with the two'ness
Go to Top of Page

jzq740176597
Tomato Guru

China
343 Posts

Posted - Nov 24 2011 :  8:34:01 PM  Show Profile  Reply with Quote
(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?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Nov 28 2011 :  12:53:13 PM  Show Profile  Reply with Quote
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 "+" ?

zen is the art of being at one with the two'ness
Go to Top of Page

jzq740176597
Tomato Guru

China
343 Posts

Posted - Nov 28 2011 :  11:37:15 PM  Show Profile  Reply with Quote
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.

Edited by - jzq740176597 on Nov 29 2011 12:04:33 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Nov 29 2011 :  3:43:47 PM  Show Profile  Reply with Quote
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

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000