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
 Change Signature doesn't adjust ptr to member
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

legalize
Tomato Guru

USA
119 Posts

Posted - Jun 23 2014 :  9:03:27 PM  Show Profile  Reply with Quote
In header:

class ChangeSignature
{
public:
    int Method3(int a, int b);
};

In cpp:

int ChangeSignature::Method3(int a, int b)
{
    return a + b;
}

static void TestMethods()
{
    ChangeSignature c;
    int (ChangeSignature::*result)(int, int) = &ChangeSignature::Method3;
    int const sum = (c.*result)(3, 4);
    assert(sum == 7);
}

Change Signature on Method3 to

int Method3(const int& a, int b);

Then the signature of the pointer-to-method variable result is not changed, leading to invalid code.

http://legalizeadulthood.wordpress.com

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jun 24 2014 :  9:57:24 PM  Show Profile  Reply with Quote
I see 2 problems here:

1. Change Signature doesn't update function pointer references (call site). I have put in a bug report for this:

case=83184

2. Change Signature doesn't update call sites when changing parameter types to pointer or reference. Usually add, remove and rename of parameters are supported when changing signature. Our free, editbox style change signature allow to do more which is helpful so you can change anything and Visual Assist will update method definition, declaration and even the overridden methods.

However, I have put in a bug report, so we can improve this in the future:

case=83185
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