...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::compute::make_transform_iterator
// In header: <boost/compute/iterator/transform_iterator.hpp> template<typename InputIterator, typename UnaryFunction> transform_iterator< InputIterator, UnaryFunction > make_transform_iterator(InputIterator iterator, UnaryFunction transform);
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: |
|
||||
Returns: |
a |