|
inlineconstexpr |
#include <eve/module/algo/algo/keep_if.hpp>
Defined in Header
Takes values that pass the predicate, and copies them to the beginning of the range. Values past the returned sentinel are to be considered garbage.
Acts like an eager version of filter, or an in-place version of std::copy_if
:
eve::algo::views::map
or eve::algo::transform_keep_if
.Tuning
dense_output
/sparse_output
: if you expect very sparse output (one or two true
s per register), you can call keep_if[sparse_output](...)
to optimize for that scenario.
Parameters
rng
: Range to modifyp
: SIMD predicate over elements of rng
Return value
Iterator past the last written element.