Template Function rcppsw::algorithm::transform_if

Function Documentation

template<class InputIterator, class OutputIterator, class Predicate, class UnaryFunction>
OutputIterator rcppsw::algorithm::transform_if(InputIterator first, InputIterator last, OutputIterator result, const Predicate &pred, const UnaryFunction &f)

Given an input range defined by (first, last), and a filtering predicate pred, apply f to all elements from the input range that satisfy pred and write them to the output range result, transforming them each via f.