Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Feature for special functions...

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
dango Posted - Dec 05 2006 : 08:42:18 AM
I haven't totally figured out what I want but let me explain the scenario.

When creating special member function: copy constructor; assignment operator its important to make sure we have copied, all the member variables. Would it be possible to check tat all member variables are referenced in these functions? Or simply insert a template for these functions that is just {lhs.a = rhs.a; lhs.b = rhs.b ...} for each member variable? Then I can edit it from there. Periodicall I could re-insert the template and check that I'm not missing anything.

Thanks,
DanGo
4   L A T E S T    R E P L I E S    (Newest First)
bugfix Posted - Dec 07 2006 : 10:14:23 AM
heh, this was meant for dango. sorry if it wasnt clear.
feline Posted - Dec 07 2006 : 10:01:20 AM
My gut instinct is that this is harder, and will have more edge cases. I know myself well enough to know that I would start to rely on any such function, once it existed, so it would need to be very reliable.

The immediate problem is to define "used". This could be defined as each member variable is referenced in the function, but is this the correct test?

The second problem is when should this be enabled? When I have classes that define both a copy constructor and an assignment operator I have a function clone(...) and these two functions both call clone() which deals with all of the member variables, so I only have one function to update and keep an eye on.
bugfix Posted - Dec 06 2006 : 09:24:52 AM
how about making a small helper function which you call in your copy ctor /assignment operator and use vs builtin classbrowser to check that all members are used?

-bugfix
feline Posted - Dec 05 2006 : 10:12:32 AM
A very interesting idea, I have put in a feature request for the developers to consider.

case=3945

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