等值和平等之间有什么区别? [英] What is the difference between equivalence and equality?

查看:72
本文介绍了等值和平等之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C ++中的相等和相等之间有什么区别?

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

有一个非常相似的问题。但是,此问题带有数学的问题,而我我对C ++上下文中的含义感兴趣。

There is a very similar question here. However, this question is tagged with math, while I am interested in the meaning in C++ context.

要查看上下文中的术语:Scott Meyers在此视频

To see the terms in context: Scott Meyers uses them in an example in this video.

推荐答案

在< a href = http://en.cppreference.com/w/cpp/language/operator_comparison rel = noreferrer> cppreference.com 我找到了以下引文:


对于同时具有EqualityComparable和LessThanComparable的类型,C ++标准库在相等性(即表达式a == b的值)和对等性(即!(a< b)&&的值(b< a)。

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).

这篇关于等值和平等之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆