实现类似matlab函数检查std :: vector是否为空的最有效方法是什么?
这是我想要的示例代码
for (int i = 0; i<N; i++) {
tmp = x[i];
if ((tmp > max) || (tmp < max)) {
indexout.push_back(tmp);
}
if ((tmp < min) && (tmp > max)) {
indexin.push_back(tmp);
}
}
if (isempty(indexin)) { //heres the part i don't know how to do
//do something
}
else