I have a vector of points, and I need to get those which are at a distance less than a value from a given point.
I could do it with a simple loop, but is there a better way to do it?
Thanks in advance
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
std::remove_copy_if:remove_copy_ifwill copy a sequence to an output iterator for each item which fails a predicate. In this case, the predicate is “x>5”. There doesn’t seem to be an equivalentcopy_iffor each item which passes a predicate test, but you can always negate a predicate withstd::not1.