A
Alexander Stippler
Hello,
I have got a list of indices stored as a stl::vector and a range given by
two iterators, lets say [from, to]. The values in this range are not
ordered, but I have another range of values, lets say lower to upper. Now I
want to remove all values from the stl vector in range [from, to] having
values in [lower, upper]. I have just tried around with remove_if and some
predicates, but I'm not used to the algorithms library. Perhaps someone can
help me.
std::vector<long> indices; // e.g. [1 3 6 2 1 4 6 2 4 1 3 5 7]
^ ^
std::vector<long>::iterator from, to; // e.g. from = indices.begin() + 3,
// to = indices.begin() + 8;
long lower, upper // e.g. lower = 1, upper = 3;
What would it look like?
std::remove_if(from, to, ???????);
regards,
Alex
I have got a list of indices stored as a stl::vector and a range given by
two iterators, lets say [from, to]. The values in this range are not
ordered, but I have another range of values, lets say lower to upper. Now I
want to remove all values from the stl vector in range [from, to] having
values in [lower, upper]. I have just tried around with remove_if and some
predicates, but I'm not used to the algorithms library. Perhaps someone can
help me.
std::vector<long> indices; // e.g. [1 3 6 2 1 4 6 2 4 1 3 5 7]
^ ^
std::vector<long>::iterator from, to; // e.g. from = indices.begin() + 3,
// to = indices.begin() + 8;
long lower, upper // e.g. lower = 1, upper = 3;
What would it look like?
std::remove_if(from, to, ???????);
regards,
Alex