Pergunta

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*/)
Foi útil?

Solução

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,

Outras dicas

Intellisence in most of the IDE will work, if not you can keep comment as well. I do not think any harm in this.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top