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
 Steps to Implement Virtual Methods
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ahkow
Senior Member

33 Posts

Posted - Aug 02 2014 :  07:49:08 AM  Show Profile  Reply with Quote
Is the following the only way to correctly use Implement Virtual Methods?
1. Go to header file.
2. Move cursor to class name
3. Open Refactor context menu and select Implement Virtual Methods.

I ask this because when I open Implement Virtual Methods under a class name in cpp file, for example under Tree in the following code:

void Tree::foo() {
}

Then VA merely inserts the following in the cpp file:

virtual void grow() override
{
}


Now the 1st problem. Notice the invalid virtual and override, and more importantly, the missing class. The correct code should be:

void Tree::grow()
{
}


And the 2nd problem, VA does not insert declaration of grow() to the header too.

Edited by - ahkow on Aug 02 2014 07:51:25 AM

feline
Whole Tomato Software

United Kingdom
15984 Posts

Posted - Aug 02 2014 :  11:47:10 AM  Show Profile  Reply with Quote
Interesting, it had never occured to me to try triggering Implement Virtual Methods from a function implementation like this. I am seeing the same problems, thank you for the clear description:

case=84158

In case you don't know, the override keyword is controlled by this setting:

http://docs.wholetomato.com/default.asp?W346

and should work correctly when you trigger Implement Virtual Methods from the class declaration.

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

sean
Whole Tomato Software

USA
2641 Posts

Posted - Sep 19 2014 :  12:48:27 AM  Show Profile  Reply with Quote
Build 2042 exposed the "override" registry setting on the Refactoring page of the VA Options dialog.

Build 2047 no longer allows Implement Virtual Methods to be executed from function implementations.
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