samedi 27 juillet 2019

What's the difference between' bool operator()' and 'bool operator <'?

I was trying to make objects of a set and when I searched in StackOverflow I found a suggestion which worked: bool operator<(.....). what does this mean? and how it's different from bool operator () ?

i tried replacing < with () but it threw an error

bool operator<(const hello &p1) const{}

(hello is a struct)

Aucun commentaire:

Enregistrer un commentaire