| Home | Libraries | People | FAQ | More

## Function template make_transform_iterator

boost::compute::make_transform_iterator

## Synopsis

    // In header: <boost/compute/iterator/transform_iterator.hpp>

    template<typename InputIterator, typename UnaryFunction>
      transform_iterator< InputIterator, UnaryFunction >
      make_transform_iterator(InputIterator iterator, UnaryFunction transform);

## Description

Returns a `transform_iterator` for `iterator` with `transform`.

For example, to create an iterator which returns the square-root of each value in a `vector<int>`:

    auto sqrt_iterator = make_transform_iterator(vec.begin(), sqrt<int>());

Parameters:

`iterator` | the underlying iterator
`transform` | the unary transform function

Returns: | a `transform_iterator` for `iterator` with `transform`