Conditionally copies values from an input range to an output range, transforming them in the process.
If the output range is too small, fills all the available space and then stops.
If the output range's element type is different from the type of the values returned by the transforming function, performs the appropriate conversions.
namespace eve::algo
{
template <eve::algo::relaxed_range In, eve::algo::relaxed_range Out, typename Func>
}
unaligned_t< iterator_t< R > > unaligned_iterator_t
Unaligned iterator for a relaxed range.
Definition: ranges_types.hpp:68
constexpr auto transform_copy_if
Similar to applying eve::transform_to and eve::copy_if at the same time.
Definition: transform_copy_if.hpp:155
Output iterator past the last written element.
#include <eve/module/core.hpp>
#include <eve/module/algo.hpp>
#include <tts/tts.hpp>
#include <iostream>
#include <vector>
int main()
{
std::vector<int> input(16);
std::cout << "Input vector:\n " << tts::as_string(input) << "\n\n";
};
std::vector<int> output_big(42);
std::cout << "Output (opposites of even numbers):\n "
<< tts::as_string(output_big)
<< "\n\n";
std::vector<unsigned char> output_small(5);
std::cout << "Output on a range too small to hold all the results,\nwith conversion to unsigned char:\n "
<< tts::as_string(output_small)
<< std::endl;
return 0;
}
Specifies semantic compatibility between wrapper/wrapped types.
Definition: product_type.hpp:107
constexpr auto iota
SIMD version of std::iota For conversion/overflow behaviour, should follow the standard.
Definition: iota.hpp:38
constexpr auto is_even
elementwise callable returning a logical true if and only if the element value is even.
Definition: is_even.hpp:78