Date
1998-10-07.00:00:00
Message id
245

Content

Table 72 in [input.iterators] specifies semantics for *r++ of:

   { T tmp = *r; ++r; return tmp; }

There are two problems with this. First, the return type is specified to be "T", as opposed to something like "convertible to T". This is too specific: we want to allow *r++ to return an lvalue.

Second, writing the semantics in terms of code misleadingly suggests that the effects *r++ should precisely replicate the behavior of this code, including side effects. (Does this mean that *r++ should invoke the copy constructor exactly as many times as the sample code above would?) See issue 334 for a similar problem.