------- Comment #3 from klra67 at freenet dot de  2007-07-24 16:10 -------
Subject: Re:  Sort of vector of template class fails

Am Montag, 23. Juli 2007 23:55 schrieb pinskia at gcc dot gnu dot org:

> This is correct, you need to mark operator< as taking a const this
> variable. Like:
>     bool operator<(const card & A)const { return this->id < A.id;};
>
> Once doing that, the program compiles.
You are right, sorry. I am not a C++ expert, and this worked without const on 
another compiler, so I got confused. BTW, I find the error message unclear 
and not helpful, even now that I understand what is going on.

Thanks!
klaus


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32851

Reply via email to