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
 Code Inspection - Convert to empty() fails
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

khb
Tomato Guru

Germany
337 Posts

Posted - Jan 14 2018 :  3:23:47 PM  Show Profile  Reply with Quote
I stumbled upon a problem with the "Convert to empty()" refactoring option. I have derived my own class from std::deque as follows:
class CMyClass : public deque<CMyStruct>
In a member function of my derived class I have the following code:
if(size() == 0)
    return;
VA suggested me "Convert to empty()" on the size function and then produced the following:
if(size->empty())
    return;
However, this is wrong and I would have expected the following:
if(empty())
    return;
I'm using VAX 2248 with VS2012.

Kind regards,
Marcus

feline
Whole Tomato Software

United Kingdom
17012 Posts

Posted - Jan 15 2018 :  08:42:06 AM  Show Profile  Reply with Quote
I am seeing the same problem here, thank you for the clear example:

case=113783

Not the first problem I have seen with convert to empty, but calling a member function on size is a new version to me.

zen is the art of being at one with the two'ness
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Jan 15 2018 :  3:31:45 PM  Show Profile  Reply with Quote
Yes, I've seen that another user also posted a problem with "Convert to empty()".
And I thought: "Let me add another test case." ;)
Thank you for reproducing the problem!

Kind regards,
Marcus
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Feb 21 2018 :  5:51:10 PM  Show Profile  Reply with Quote
case=113783 was a duplicate of case=112036
case=112036 is fixed in build 2258

Edited by - sean on Feb 21 2018 5:52:02 PM
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000