Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Including default arguments in source file

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
Mattijs Posted - Oct 03 2006 : 06:14:17 AM
When Visual Assist suggests the parameter list for a function implementation in a source file, it includes the values for default arguments of the function declaration as comments. Is it possible to turn off these comments?
5   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Oct 07 2006 : 1:10:36 PM
we try to avoid adding options, partly because it is easy to have to many, but mainly because each option adds a lot of extra work, due to the way VA has to hook into the IDE all over the place.
Mattijs Posted - Oct 06 2006 : 05:04:01 AM
I just discovered 'Change Signature', and that will make keeping the two function headers the same a lot easier! Still, it would have been nice to be able to turn the automatic comments off.
feline Posted - Oct 05 2006 : 09:56:20 AM
if you are using the current release build of VA, 1535, sit on the function and try the new feature "Change Signature". this updates both the .h and the .cpp file, and updates the comments for you as well, all in one simple action

personally I find this to be invaluable, and a big time saver.

overloaded functions, perhaps this is just the way i structure my code, but sometimes I end up with something like this:


class doWork
{
private:
    addRecord(int a, int b, int c);

public:
    // both call the private function with the correct parameters
    addRecord(int a, bool d = true);
    addRecord(std::string a, bool d = true);
};


where changing the default parameter is a special case, only rarely used, which can have a fairly big effect. when i am sitting in the cpp file it helps me to be reminded that the bool is this default parameter, and that i need to keep a careful eye on it.

also it helps me when jumping up and down the cpp file to check how many parameters i need to pass
Mattijs Posted - Oct 04 2006 : 04:22:29 AM
Thanks for the reply. They are not causing problems for me, I just delete them. My main problem is that the comments (obviously) do not change when the function declaration in the header file is changed. For example, when I change the last default argument of a function declaration in a header file from true to false, the comment in the source file will still show /* = true */. You have to realise to change comments every time when changing a default parameter. Otherwise, the comment is not helpful, but misleading. Therefore, I prefer to have no comments.
About your last remark: I do not see the link between the default argument comments and overloaded functions.
feline Posted - Oct 03 2006 : 1:02:49 PM
no. are they causing problems for you? or is this just a matter of personal preference?
personally i find them very helpful, especially when dealing with overloaded functions.

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