A random-access input (read-only) iterator adaptor for transforming dereferenced values.
More...
#include <transform_iterator.hpp>
template<class InputIterator, class UnaryFunction, class ValueType = typename ::rocprim::detail::invoke_result< UnaryFunction, typename std::iterator_traits<InputIterator>::value_type >::type>
class transform_iterator< InputIterator, UnaryFunction, ValueType >
A random-access input (read-only) iterator adaptor for transforming dereferenced values.
- Overview
- A transform_iterator uses functor of type UnaryFunction to transform value obtained by dereferencing underlying iterator.
- Using it for simulating a range filled with results of applying functor of type
UnaryFunction
to another range saves memory capacity and/or bandwidth.
- Template Parameters
-
InputIterator | - type of the underlying random-access input iterator. Must be a random-access iterator. |
UnaryFunction | - type of the transform functor. |
ValueType | - type of value that can be obtained by dereferencing the iterator. By default it is the return type of UnaryFunction . |
◆ pointer
template<class InputIterator, class UnaryFunction, class ValueType = typename ::rocprim::detail::invoke_result< UnaryFunction, typename std::iterator_traits<InputIterator>::value_type >::type>
A pointer type of the type iterated over (value_type
).
It's const
since transform_iterator is a read-only iterator.
◆ reference
template<class InputIterator, class UnaryFunction, class ValueType = typename ::rocprim::detail::invoke_result< UnaryFunction, typename std::iterator_traits<InputIterator>::value_type >::type>
A reference type of the type iterated over (value_type
).
It's const
since transform_iterator is a read-only iterator.
◆ transform_iterator()
template<class InputIterator, class UnaryFunction, class ValueType = typename ::rocprim::detail::invoke_result< UnaryFunction, typename std::iterator_traits<InputIterator>::value_type >::type>
Creates a new transform_iterator.
- Parameters
-
iterator | input iterator to iterate over and transform. |
transform | unary function used to transform values obtained from range pointed by iterator . |
The documentation for this class was generated from the following file: