This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13542] New: the overload of < operator doesn't work for complex<double> when use stl sort
- From: "tjiq at 21cn dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jan 2004 04:37:55 -0000
- Subject: [Bug c++/13542] New: the overload of < operator doesn't work for complex<double> when use stl sort
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
the code following doesn't compile:
typedef complex<double> Tp;
vector<Tp> vp;
int operator<(const Tp &a, const Tp &b)
{
return a.imag()<b.imag();
}
sort(vp.begin(),vp.end());
--
Summary: the overload of < operator doesn't work for
complex<double> when use stl sort
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tjiq at 21cn dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13542