Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Change Signature doesn't adjust ptr to member

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
legalize Posted - Jun 23 2014 : 9:03:27 PM
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.
1   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Jun 24 2014 : 9:57:24 PM
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

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