Re: const problem

Tech-Archive recommends: Fix windows errors by optimizing your registry



"Doug Harrison [MVP]" <dsh@xxxxxxxx> wrote in message
news:u1v7a2lq527mpd4m46bemrj4a0s5eeojfl@xxxxxxxxxx
When you add the const and make the function a const member function, it
has the type:

const MyCompare* const this;

You need a const member function here because std::set is calling it
through a const MyCompare object, which is what the compiler is telling
you:

Understood. Thanks very much for the explaination! This was my first
experience with const member functions.

P.S. Sorry for leaving const off the example I gave you on 6/27. It
happens. :)

No problem. I learned a lot trying to figure this one out. :-)

Bruce.


.