E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ transform_keep_if

auto eve::algo::transform_keep_if = function_with_traits<transform_keep_if_>[no_traits]
inlineconstexpr

#include <eve/module/algo/algo/transform_keep_if.hpp>

Defined in Header

#include <eve/module/algo.hpp>

Conditionally copies values that pass a predicate to the beginning of the range, transforming them in the process. Values past the returned sentinel are to be considered garbage.

Note
If the scalar operation is cheap enough, keep_if + views::map might be slightly faster.
See transform_copy_if and keep_if for more details.

Callable Signatures

{
template<relaxed_range Rng, typename Func>
auto transform_keep_if(Rng&& rng, Func func) -> unaligned_iterator_t<Rng>
}
unaligned_t< iterator_t< R > > unaligned_iterator_t
Unaligned iterator for a relaxed range.
Definition ranges_types.hpp:68
constexpr auto transform_keep_if
In-place version of eve::algo::transform_copy_if
Definition transform_keep_if.hpp:114

Parameters

  • rng: Range to modify
  • func: Function that takes elements from rng as SIMD registers and returns a pair of:
    • the transformed values
    • a logical mask

Return value

Iterator past the last written element.

See also
keep_if
copy_if
remove_if
transform_copy_if
transform_inplace
views::map