reference type of output_iterator_wrapper
Douglas Gregor
doug.gregor@gmail.com
Tue Apr 18 14:05:00 GMT 2006
On Apr 17, 2006, at 3:59 PM, Howard Hinnant wrote:
> Fwiw I suggested the standard do something like this in Berlin and
> got met with pretty strong opposition (give a non-void
> iterator_traits to output iterators).
I obviously missed that part of the discussion.
> The standard currently says that value_type and difference_type
> should be void for output iterators (24.3.1/1). I think it's a bad
> rule, and apparently I'm not alone. But there's an up hill battle
> in the LWG here. Packaging it with concepts might help.
Well, the right thing to do with value_type and difference_type for
output iterators is to say nothing at all about them. void is
blatantly wrong, because:
- if it's an output iterator, difference_type must be void
- if it's a forward iterator, difference_type must be a signed
integral type
- every forward iterator is an output iterator
- but void isn't a signed integral type
Anyway, we'll clean this up with concepts.
Doug
More information about the Libstdc++
mailing list