std::map operator<

C

Chris Forone

how is it possible with a userdefined class with the only overloaded
operator< (less than) to find the right object (function .find could not
know if greater or equal)?

thanks for your patience
 
K

Kai-Uwe Bux

Chris said:
how is it possible with a userdefined class with the only overloaded
operator< (less than) to find the right object (function .find could not
know if greater or equal)?

Two keys a and b are considered equal if neither a < b nor b < a. The
requirement that operator< defines a strict weak ordering ensure that

a ~ b := ( neither a < b nor b < a )

defines an equivalence relation.


Best

Kai-Uwe Bux
 
C

Chris Forone

Kai-Uwe Bux said:
Two keys a and b are considered equal if neither a < b nor b < a. The
requirement that operator< defines a strict weak ordering ensure that

a ~ b := ( neither a < b nor b < a )

defines an equivalence relation.


Best

Kai-Uwe Bux

wow :) thanx a lot!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,201
Messages
2,571,052
Members
47,656
Latest member
rickwatson

Latest Threads

Top