This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project. See the libstdc++ home page for more information.


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

Re: testcase correction


Jason Merrill <jason@cygnus.com> writes:

> >>>>> Benjamin Kosnik <bkoz@cygnus.com> writes:
> 
>  > ++ ++it;
> 
> I don't think it's a "convention", it's just testing that well-formed, if
> pathological, code works.  ++it is an lvalue, so you can apply another ++.

Yes, that's it, all I want to do is to test that the return value can
be modified. This is also the way a built-in type works.

To make code even more unreadable :-) note that the statement

   iter++ ++;

only increments the iterator once! (the second operator acts on the
temporary returned by the first operator.)

Philip