function object
std::ranges::transform
- Header
<algorithm>- Draft
- [alg.transform]
- Scope
std::ranges- cppreference
- std::ranges::transform
Synopsis
inline constexpr /* implementation-defined */ transform = {};Call signatures
transform is a function object; these are its call operators as libycxx declares them, written as the functions the draft declares.
- (1)
template< std::ranges::input_range R, std::weakly_incrementable O, std::copy_constructible F, class Proj = std::identity> requires std::indirectly_writable<O, std::indirect_result_t<F&, std::projected<iterator_t<R>, Proj>>> constexpr std::ranges::unary_transform_result<borrowed_iterator_t<R>, O> transform( R&& r, O result, F op, Proj proj = {}); - (2)
template< std::input_iterator I, std::sentinel_for<I> S, std::weakly_incrementable O, std::copy_constructible F, class Proj = std::identity> requires std::indirectly_writable<O, std::indirect_result_t<F&, std::projected<I, Proj>>> constexpr std::ranges::unary_transform_result<I, O> transform( I first1, S last1, O result, F op, Proj proj = {}); - (3)
template< std::ranges::input_range R1, std::ranges::input_range R2, std::weakly_incrementable O, std::copy_constructible F, class Proj1 = std::identity, class Proj2 = std::identity> requires std::indirectly_writable<O, std::indirect_result_t<F&, std::projected<iterator_t<R1>, Proj1>, std::projected<iterator_t<R2>, Proj2>>> constexpr std::ranges::binary_transform_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O> transform( R1&& r1, R2&& r2, O result, F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); - (4)
template< std::input_iterator I1, std::sentinel_for<I1> S1, std::input_iterator I2, std::sentinel_for<I2> S2, std::weakly_incrementable O, std::copy_constructible F, class Proj1 = std::identity, class Proj2 = std::identity> requires std::indirectly_writable<O, std::indirect_result_t<F&, std::projected<I1, Proj1>, std::projected<I2, Proj2>>> constexpr std::ranges::binary_transform_result<I1, I2, O> transform( I1 first1, S1 last1, I2 first2, S2 last2, O result, F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); - (5)
template< class ExecutionPolicy, sized_random_access_range R, sized_random_access_range OutR, std::copy_constructible F, class Proj = std::identity> requires execution-policy<ExecutionPolicy> && std::indirectly_writable<std::ranges::iterator_t<OutR>, std::indirect_result_t<F&, std::projected<std::ranges::iterator_t<R>, Proj>>> std::ranges::in_out_result<std::ranges::borrowed_iterator_t<R>, std::ranges::borrowed_iterator_t<OutR>> transform( ExecutionPolicy&& exec, R&& r, OutR&& result_r, F op, Proj proj = {}) noexcept; - (6)
template< class ExecutionPolicy, std::random_access_iterator I1, std::sized_sentinel_for<I1> S1, std::random_access_iterator I2, std::sized_sentinel_for<I2> S2, std::random_access_iterator O, std::sized_sentinel_for<O> OutS, std::copy_constructible F, class Proj1 = std::identity, class Proj2 = std::identity> requires execution-policy<ExecutionPolicy> && std::indirectly_writable<O, std::indirect_result_t<F&, std::projected<I1, Proj1>, std::projected<I2, Proj2>>> std::ranges::in_in_out_result<I1, I2, O> transform( ExecutionPolicy&&, I1 first1, S1 last1, I2 first2, S2 last2, O result, OutS result_last, F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}) noexcept; - (7)
template< class ExecutionPolicy, std::random_access_iterator I, std::sized_sentinel_for<I> S, std::random_access_iterator O, std::sized_sentinel_for<O> OutS, std::copy_constructible F, class Proj = std::identity> requires execution-policy<ExecutionPolicy> && std::indirectly_writable<O, std::indirect_result_t<F&, std::projected<I, Proj>>> std::ranges::in_out_result<I, O> transform( ExecutionPolicy&&, I first1, S last1, O result, OutS result_last, F op, Proj proj = {}) noexcept; - (8)
template< class ExecutionPolicy, sized_random_access_range R1, sized_random_access_range R2, sized_random_access_range OutR, std::copy_constructible F, class Proj1 = std::identity, class Proj2 = std::identity> requires execution-policy<ExecutionPolicy> && std::indirectly_writable<std::ranges::iterator_t<OutR>, std::indirect_result_t<F&, std::projected<std::ranges::iterator_t<R1>, Proj1>, std::projected<std::ranges::iterator_t<R2>, Proj2>>> std::ranges::in_in_out_result<std::ranges::borrowed_iterator_t<R1>, std::ranges::borrowed_iterator_t<R2>, std::ranges::borrowed_iterator_t<OutR>> transform( ExecutionPolicy&& exec, R1&& r1, R2&& r2, OutR&& result_r, F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}) noexcept;