Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Encapsulate field is wrong on static members

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
xMRi Posted - Jun 22 2016 : 06:07:27 AM
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)
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Sep 14 2018 : 10:00:52 AM
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.
xMRi Posted - Sep 13 2018 : 07:36:38 AM
Stumbled again over a static member were the getter and setter are created non static.
Just a small reminder on case=15983 ;)
feline Posted - Jun 23 2016 : 2:19:03 PM
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.

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