This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: reference type of output_iterator_wrapper



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]