Boost logo

Boost Users :

Subject: Re: [Boost-users] [iterator] - does there exist an opposite of Function Output Iterator?
From: Michael Fawcett (michael.fawcett_at_[hidden])
Date: 2009-02-05 12:51:59


On Thu, Feb 5, 2009 at 12:33 PM, Steven Watanabe <watanabesj_at_[hidden]> wrote:
>
> Michael Fawcett wrote:
>>
>> http://www.boost.org/doc/libs/1_37_0/libs/iterator/doc/function_output_iterator.html
>>
>> Shows a unary function being adapted as an OutputIterator. Does Boost
>> have something that does the opposite, i.e. takes an OutputIterator
>> and adapts it as a unary function object?
>
> using namespace boost::lambda;
> *var(i)++ = _1;

Thanks, as always, Steven.

While clever, Boost.Lamba seems like overkill for this extremely
simple task. Is it your experience that it would generate code as
efficient as what I originally posted?

Do you feel that such functionality doesn't belong in Boost.Iterator?
I think it nicely complements function_output_iterator.

--Michael Fawcett


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net