Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practice : Hide unused parameter

Tags:

c++

I'm adding a method in class which has some parameters but still needs to be implemented later.

I.e.

void AAA::doSmth(const int32_t status)
{
    // TODO : Add implementation
}

During compilation I get warning about unused parameter. Basically what I want to do is to do some trick that makes compiler to not print warning about unused parameter, but still keep empty implementation.

So I would like to know what is the best practice to have some "dummy" usage of parameter in order to avoid the warning during compilation ? What is the best practice ???

Please do not offer any IDE or compiler related option to hide the warning !!!

like image 826
deimus Avatar asked Dec 16 '22 14:12

deimus


1 Answers

I usually simply comment out the parameter like so:

void AAA::doSmth(const int32_t /*status*/)
{
    // TODO : Add implementation
}
like image 196
Ivaylo Strandjev Avatar answered Dec 30 '22 15:12

Ivaylo Strandjev