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
 Too many references for overloads
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

andre.horst
Tomato Guru

Germany
150 Posts

Posted - Sep 20 2010 :  04:14:15 AM  Show Profile  Reply with Quote
Latest VAX (even lower), VC++2008 (even lower), WinXP SP3. Try following code

class CTest
{
public:

    void f( int& p )
    {
        this->f< int& >( p, 1 ) ;
    }

    template< class T >
    void f( T p, int x ) // Place cursor on "f" and "rename" or "find refs"
    {
        p = 1234 * x ;
    }

} ;

int _tmain(int argc, _TCHAR* argv[])
{
    int n = 0 ;
    CTest t ;
    t.f( n ) ;
    t.f( n, 10 ) ;
    return 0;
}

The references-dialog shows all overloads instead the right one. a accidental click on rename can cause big, big, really big trouble in the code.
I did not checked if this failure is in other overloads than in template-methods, but i could imagine that.

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 20 2010 :  1:27:34 PM  Show Profile  Reply with Quote
We are considering doing this at some point:

case=2732

Personally I think that overloaded methods should do the same job with different incoming parameters. From this point of view renaming all overloaded functions may not be a problem. Luckily, this approach should not break the functionality.

I agree that you should be allowed to only rename the selected function, though.
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