What would be the most efficient way to implement a matlab like function to check if an std::vector is empty?
here’s a sample code of what i am trying to
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
Use
vector::empty().