Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Code Inspection - Convert to empty() fails

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
khb Posted - Jan 14 2018 : 3:23:47 PM
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
3   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Feb 21 2018 : 5:51:10 PM
case=113783 was a duplicate of case=112036
case=112036 is fixed in build 2258
khb Posted - Jan 15 2018 : 3:31:45 PM
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
feline Posted - Jan 15 2018 : 08:42:06 AM
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.

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