转载:https://www.cnblogs.com/liushui-sky/p/6549402.html
Q_UNUSED() 方法的使用
//比如说
int testFunc(int a, int b, int c, int d)
{
int e;
return a+b+c;
}
//编译器会有警告 d和e未使用;
//于是
int testFunc(int a, int b, int c, int d)
{
int e;
Q_UNUSED(d)
Q_UNUSED(e)
return a+b+c;
}
//多数时候,这样用总不是太好
//比如 e,就不该出现,
//对于d,也可以 注释掉
int testFunc(int a, int b, int c, int /* d */)
{
//int e;
return a+b+c;
}