这是一段c++代码:
Cacheline& first_hit(uint32_t address){ for(auto& i:cachelines) if(i.hit(address)) return i; assert(false); }
我的想法是当你调用这个函数时,你可以确定这个函数会在for循环时返回值(否则触发assert)
问题是这里编译器会给我一个[-Wreturn-type]警告,我想关闭这个警告(仅在这个函数中关闭),怎么办?