This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/13542] New: the overload of < operator doesn't work for complex<double> when use stl sort


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


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