C++ overloading operators difference between == and <

前端 未结 6 1411
花落未央
花落未央 2021-01-21 17:01

Could anybody explain me what is the difference between overload == and <?

For example, if I use a map:

map         


        
6条回答
  •  渐次进展
    2021-01-21 17:15

    Because std::map has such behaviour, it uses std::less functor or your functor for many operations.

    Behaviour can be different, but usual checks that lhs is less than rhs.

提交回复
热议问题