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
 Encapsulate field is wrong on static members
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

xMRi
Tomato Guru

Germany
315 Posts

Posted - Jun 22 2016 :  06:07:27 AM  Show Profile  Reply with Quote
Build 2101.

1. See this code
class CFoo
{
public:
	CFoo();
	~CFoo();

protected:
	static bool	m_bFoo;
};


bool CFoo::m_bFoo = true;

CFoo::CFoo()
{
	if (bFoo)
	{

	}
}


Using encapsulate fields also tries to change the definition of m_bFoo from
bool CFoo::m_bFoo = true;

to the following wrong code:
bool CFoo::SetFoo(true);


2. Also it would be nice that VAX detects that we have a static member and would make the Getter and Setter static too.
(just a nice to have)

3. There are cases were I only want a setter or only a getter. The current dialog doesn't allow me an empty getter or setter.
(just a nice to have)

Martin Richter [rMVP] WWJD http://blog.m-ri.de
"A well-written program is its own heaven; a poorly written
program is its own hell!" The Tao of Programming

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Jun 23 2016 :  2:19:03 PM  Show Profile  Reply with Quote
Thank you for the very clear example, that is rather unhelpful:

case=98260

point 2, yes, the functions do need to be made static as well:

case=15983

Point 3, are you getting code updates as well for the unwanted getter / setter? Adding something to the dialog, to specify which functions you want is one solution here, but in terms of using the command, it might be as fast to delete the unwanted function (a single line of code) as it would be to use the extra controls in the dialog. But this only holds if the extra function is not being inserted into your code in several places, so you would have to undo the edit.

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

xMRi
Tomato Guru

Germany
315 Posts

Posted - Sep 13 2018 :  07:36:38 AM  Show Profile  Reply with Quote
Stumbled again over a static member were the getter and setter are created non static.
Just a small reminder on case=15983 ;)

Martin Richter [rMVP] WWJD http://blog.m-ri.de
"A well-written program is its own heaven; a poorly written
program is its own hell!" The Tao of Programming
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Sep 14 2018 :  10:00:52 AM  Show Profile  Reply with Quote
Thank you for the reminder. This is still in the list, but I don't currently have an estimate for when we are going to have a look at this. It is one among quite a few, so it might be a little while yet.

zen is the art of being at one with the two'ness
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