$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] [Boost.Iterator] transform_iterator equivalent for output iterators
From: dariomt_at_[hidden]
Date: 2015-07-30 07:06:06
Here is my problem: for any given algorithm that writes its output into an
output iterator, I'd like to apply a transformation *before* writing to the
output iterator.
e.g. inside the algorithm the output iterator is dereferenced and
incremented to write each result, typically like this:
*output++ = ith_result;
I'd like to wrap the output iterator with a unary function func such that
the effect is equivalent to:
*output++ = func( ith_result );
I'm looking at the adaptors in Boost.Iterator but I cannot find a suitable
one.
Am I missing anything?
Is there a better approach?
Regards