我正在类中添加一个方法,该方法具有一些参数但仍需要稍后实现。
即
void AAA::doSmth(const int32_t status)
{
// TODO : Add implementation
}
在编译期间,我收到有关未使用参数的警告。 基本上我想做的是做一些技巧,让编译器不打印关于未使用参数的警告,但仍然保持空实现。
所以我想知道为了避免在编译期间出现警告而对参数进行一些“虚拟”使用的最佳做法是什么?最佳做法是什么???
请不要提供任何 IDE 或编译器相关选项来隐藏警告!!!
最佳答案
我通常会像这样简单地注释掉参数:
void AAA::doSmth(const int32_t /*status*/)
{
// TODO : Add implementation
}
关于c++ - 最佳实践 : Hide unused parameter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14559970/