What is the difference between equivalence and equality?

前端 未结 1 424
你的背包
你的背包 2021-02-05 06:41

What is the difference between equivalence and equality in C++?

There is a very similar question here. However, this question is tagged with math, while I am interested

1条回答
  •  醉话见心
    2021-02-05 07:29

    On cppreference.com i found the following quote:

    For the types that are both EqualityComparable and LessThanComparable, the C++ standard library makes a distinction between equality, which is the value of the expression a == b and equivalence, which is the value of the expression !(a < b) && !(b < a).

    0 讨论(0)
提交回复
热议问题