Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-06-13 07:05:23


You go, Aleksey!
Just remember to write (and run) a test to exercise your change.

Thanks for your contribution,
Dave

----- Original Message -----
From: "Aleksey Gurtovoy" <alexy_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, June 13, 2001 7:22 AM
Subject: RE: [boost] operators library

> David Abrahams wrote:
> > The interface to output_iterator_helper needs to be changed anyway, to
> > remove all of those parameters which default to void (an
> > output iterator /must/ have void value_type and differnce_type anyway).
>
> Talking about interface changes - how about this:
>
> template<class Derived>
> struct output_iterator_helper
> : boost::incrementable<Derived
> , boost::iterator<std::output_iterator_tag, void, void, void, void
> > >
> {
> Derived& operator*() { return static_cast<Derived&>(*this); }
> Derived& operator++() { return static_cast<Derived&>(*this); }
> };
>
> Self-proxing is the most common and easy way to implement output
iterators,
> and IMO it would be reasonable for 'output_iterator_helper' to provide a
> default support for the idiom, if this does not prevent other usages.
AFAIK,
> the above form doesn't. Basically, it's what we are using here at work,
and
> I would love to replace it by the boost code instead :).
>
> Aleksey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk