
Episode 124: Vectorizing std::views::filter
Algorithms + Data Structures = Programs
00:00
The Problem With Filtering in an Array Language
There's two arguments to this test search function one is a double-star Underscore underscore restrict underscore underscore a and the other one is a size t called n. We then have a for loop from I equals zero Up till n and then we're incrementing and then we've got a while loop Inside this for loop that is hard coding our unary predicate of Trying to basically see if it's greater than zero and keeping it in place. Yeah, it's pretty horrific code. It hurts my soul that inner that inner while loop is Is the fine diff That we're doing in a filter view. Throughout this exercise going to get to a much better version of filter in my book for
Transcript
Play full episode