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
 Extract Function fails on template expression
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

legalize
Tomato Guru

USA
119 Posts

Posted - Jun 24 2014 :  12:24:19 AM  Show Profile  Reply with Quote

template <typename T>
T add3(T a, T b)
{
    // #TEST#: EXF19 Extract Function on expression
    // #TEST#: EXF20 Extract Function on statement
    return a + b;
}

EXF19 and EXF20 fail and introduce invalid code:

T MyMethod(T a, T b)
{
    return a + b;
}

template <typename T>
T add3(T a, T b)
{
    // #TEST#: EXF19 Extract Function on expression
    // #TEST#: EXF20 Extract Function on statement
    return MyMethod(a, b);
}

The type of the values in the expression are template types and therefore the extracted function needs to be a template function.

http://legalizeadulthood.wordpress.com

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jun 25 2014 :  5:06:27 PM  Show Profile  Reply with Quote
I am seeing the same problem here. Thank you for the clear description.

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