Relaxing Requirement on Iterator++ result ----------------------------------------- 26-Jan-95 by Nathan Myers X3J16/95-0021 Rogue Wave Software WG21/0621 The standard iterator istreambuf_iterator does not conform to the requirements in table 16 of Clause 17 describing Input Iterators. In particular, its operator++(int) returns not the iterator types themselves, but an object which is convertible to that type and defines some operations also performed by that type. This is necessary for performance, and does not affect the correctness of the algorithms which use the iterators. This proposal is to relax the requirements mentioned, and also similar requirements in tables 17, 18, 19, and 20 on operators ++ and --. Specifically, I would change the notation of the result type of expressions like "r++" from "X&" to "convertible to const X&". Furthermore, I would add to the requirements, for each expression r++, r--, a corresponding expression like *r++, *r--, specified to yield the same result as *a in the same table, and with semantics like the composition of the two operators. The reason this makes a difference is that the result of r++ can implement operator* directly, without first converting to the iterator type; and allowing it permits a much more efficient iterator. If this proposal is not accepted, we will need to change the specification of the istreambuf_iterator, at a cost in performance. Further, user iterators would be overconstrained at a similar cost in performance.