Sumit Rajan wrote:
>
> > int main()
> > {
> > Piece p = none;
> > cout << p << " " << p++ << " " << ++p << endl;
> > }
> >
> > The output from g++ and several other compilers is _not_
> >
> > 0 0 2
> >
> > as expected. In g++ it is
> >
> > 2 1 1
> >
> > Is there a bug in the code, or in the compilers?
> >
> > /David
>
> Comeau C++ came up with the expected output: 0 0 2
Doesn't matter what's expected. What matters is what's required. The
behavior of the program is undefined. Anything goes.
--
Pete Becker
Dinkumware, Ltd. (
http://www.dinkumware.com)