This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug c++/22248] New: Incorrect work with multiple assigment.
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: gcc-bugzilla at gcc dot gnu dot org
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jun 2005 15:17:57 +0200
- Subject: Re: [Bug c++/22248] New: Incorrect work with multiple assigment.
- References: <20050630130321.22248.algorithmus@gmail.com>
"algorithmus at gmail dot com" <gcc-bugzilla@gcc.gnu.org> writes:
| ---new.cpp----
| #include<cstdio>
|
| #define swap(a,b) a^=b^=a^=b
You're modifying objects more than once without intervening sequence
points. All bets are off. There is a standard utility std::swap() from
<utility> that works all the time.
PR invalid.
-- Gaby