Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Too many references for overloads

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
andre.horst Posted - Sep 20 2010 : 04:14:15 AM
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.
1   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Sep 20 2010 : 1:27:34 PM
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.

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