Boost logo

Boost :

From: John E. Potter (jpotter_at_[hidden])
Date: 2001-06-06 22:34:59

On Wed, 6 Jun 2001, David Abrahams wrote:

> From: "Aleksey Gurtovoy" <alexy_at_[hidden]>
> > template <class T>
> > struct output_iterator_helper
> > : incrementable<T
> > , boost::iterator<std::output_iterator_tag, void, void, void, void
> > > > {};
> Why should reference and pointer be void by default? Do we mean void& and
> void* (or something)?

There is no void& and you can't do anything with a void*. You can't
read an output_iterator; so, it doesn't have a value_type => void.
You can't compare output_iterators; so difference_type has no meaning
=> void. 24.3.1 covers the last two.

> I tend to agree. One could imagine generic output iterators, to which /any/
> type could be written, but surely that's not a reasonable requirement to
> impose.

It's really simple. The only thing you can do is *it = t; ++it. Either
it works or it doesn't.

> As a matter of fact, I think the output iterator requirements table is a
> complete mess. I guess I'm submitting an issue right away.

Looks good to me. Now, the input iterator table does not even have the
same format as the others, but that is another subject for another place.


Boost list run by bdawes at, gregod at, cpdaniel at, john at