Reputation: 25738
when using default parameter, I set
void method1(float v, float w =1.0)
Is this a good practice to use the comment in the definition like
void class::method1(float v, float w /*=1/0*/)
Upvotes: 0
Views: 193
Reputation: 1
I would prefer some doxygen compliant documentation this way:
/**
* Description of the behavior/purpose of your method
*
* @param v The float 'v' (whatever this means)
* @param w Optional float 'w' (whatever this means), default value is 1.0.
*/
void method1(float v, float w =1.0);
Usually I'm not going to put additional comments with implementation specific blocks,
Upvotes: 1
Reputation: 9841
Intellisence in most of the IDE will work, if not you can keep comment as well. I do not think any harm in this.
Upvotes: 0