当前位置: 首页 > news >正文

做网络课堂的平台有哪些网站公司做网络推广哪个网站好

做网络课堂的平台有哪些网站,公司做网络推广哪个网站好,wordpress循环分类,网站模版免费三向比较运算符可以用于确定两个值的大小顺序&#xff0c;也被称为太空飞船操作符。使用单个表达式&#xff0c;它可以告诉一个值是否等于&#xff0c;小于或大于另一个值。 它返回的是类枚举&#xff08;enumeration-like&#xff09;类型&#xff0c;定义在 <compare> …

三向比较运算符可以用于确定两个值的大小顺序,也被称为太空飞船操作符。使用单个表达式,它可以告诉一个值是否等于,小于或大于另一个值。

它返回的是类枚举(enumeration-like)类型,定义在 <compare>std 名称空间中。其运算的结果如下:

数据类型含义
如果操作数为整数类型,其结果称为 强排序(strong_ordering)strong_ordering::less左边的操作数小于右边的操作数
strong_ordering::greater左边的操作数大于右边的操作数
strong_ordering::equal左边的操作数等于右边的操作数
如果操作数为浮点类型,其结果称为 偏序(partial_ordering)partial_ordering::less左边的操作数小于右边的操作数
partial_ordering::greater左边的操作数大于右边的操作数
partial_ordering::equivalent左边的操作数等于右边的操作数
partial_ordering::unordered无法比较时(有一个非数字)
如果操作数为自己实现的类型,称为 弱排序(weak_ordering)weak_ordering::less左边的操作数小于右边的操作数
weak_ordering::greater左边的操作数大于右边的操作数
weak_ordering::equivalent左边的操作数等于右边的操作数

三向比较运算符的用法

三向比较运算符的使用方式如下:

#include <iostream>using namespace std;int main() {int i{ 11 };strong_ordering result{ i <=> 0 };cout << typeid(result).name() << endl;if (result == strong_ordering::less) { cout << "less" << endl; };if (result == strong_ordering::greater) { cout << "greater" << endl; };if (result == strong_ordering::equal) { cout << "equal" << endl; };return 0;
}

可以得到以下的输出结果

struct std::strong_ordering
greater

同时,<compare> 还提供了一些函数来解释排序结果,有以下几种:std::is_eq()is_neq()is_lt()is_lteq()is_gt()is_gteq()

使用的方式如下:

#include <iostream>
#include <compare>
using namespace std;int main() {int i{ 11 };strong_ordering result{ i <=> 0 };cout << typeid(result).name() << endl;if (is_lt(result)) { cout << "less" << endl; };if (is_gt(result)) { cout << "greater" << endl; };if (is_eq(result)) { cout << "equal" << endl; };return 0;
}

三向比较运算符的作用

在编写自己的类时,如果需要实现比较运算符,在 C++20 之前,通常要重载 6 个比较运算符:(><<=>===, !=)。在 C++20 引入了三向比较运算符以后,就可以只重载 <=>== 后,其他的运算符会由编译器为我们生成。(在 C++20 中,重载了 == 后,!= 也会自动重载)

以下是使用示例:

#include <iostream>
#include <compare>
using namespace std;class MyClass {
public:MyClass(int ini) : _data{ ini } {}auto operator<=>(const MyClass& other) const {return this->_data <=> other._data;}auto operator==(const MyClass& other) const {return this->_data == other._data;}
private:int _data;
};int main() {MyClass a{ 10 }, b{ 20 };if (a < b) {cout << "a < b" << endl;}if (a != b) {cout << "a != b" << endl;}return 0;
}

可以得到以下的运算结果:

a < b
a != b

文章转载自:
http://dinncogaze.ssfq.cn
http://dinncowaterhead.ssfq.cn
http://dinncostallage.ssfq.cn
http://dinncoredefection.ssfq.cn
http://dinncobeaverboard.ssfq.cn
http://dinncoomuda.ssfq.cn
http://dinncosupernal.ssfq.cn
http://dinncohyposensitization.ssfq.cn
http://dinncodispensable.ssfq.cn
http://dinncosintra.ssfq.cn
http://dinncodalesman.ssfq.cn
http://dinncoandrogyne.ssfq.cn
http://dinncoarthropathy.ssfq.cn
http://dinncodiaspora.ssfq.cn
http://dinnconulliparous.ssfq.cn
http://dinncoesophagoscopy.ssfq.cn
http://dinncoquinquevalence.ssfq.cn
http://dinncorecept.ssfq.cn
http://dinncopock.ssfq.cn
http://dinncomesne.ssfq.cn
http://dinncodilution.ssfq.cn
http://dinncoquenchless.ssfq.cn
http://dinncogarth.ssfq.cn
http://dinncogeorgiana.ssfq.cn
http://dinncohypophloeodal.ssfq.cn
http://dinncosupervisee.ssfq.cn
http://dinncoinorb.ssfq.cn
http://dinncotubful.ssfq.cn
http://dinncoseawise.ssfq.cn
http://dinncocoaster.ssfq.cn
http://dinncomicrochemistry.ssfq.cn
http://dinncowobbly.ssfq.cn
http://dinncoisraelite.ssfq.cn
http://dinncocuttloefish.ssfq.cn
http://dinncoisopulse.ssfq.cn
http://dinncomegapolis.ssfq.cn
http://dinncoreportable.ssfq.cn
http://dinncojerid.ssfq.cn
http://dinncotolu.ssfq.cn
http://dinncomagnetize.ssfq.cn
http://dinncoling.ssfq.cn
http://dinncorelator.ssfq.cn
http://dinncoarteriogram.ssfq.cn
http://dinncofarcicality.ssfq.cn
http://dinncodetoxicate.ssfq.cn
http://dinncoprotonate.ssfq.cn
http://dinncosqueezer.ssfq.cn
http://dinncosuperfix.ssfq.cn
http://dinncophonomania.ssfq.cn
http://dinncohyperplane.ssfq.cn
http://dinncopreamplifier.ssfq.cn
http://dinncopatrol.ssfq.cn
http://dinncolimmasol.ssfq.cn
http://dinncoinflective.ssfq.cn
http://dinncoikan.ssfq.cn
http://dinncostitchwork.ssfq.cn
http://dinncomicroenvironment.ssfq.cn
http://dinncoinfidelic.ssfq.cn
http://dinncosorry.ssfq.cn
http://dinncobray.ssfq.cn
http://dinncomagician.ssfq.cn
http://dinncoitinerancy.ssfq.cn
http://dinncodeoxidization.ssfq.cn
http://dinncohickwall.ssfq.cn
http://dinncomaoize.ssfq.cn
http://dinncotraxcavator.ssfq.cn
http://dinncoquartation.ssfq.cn
http://dinncoinvoice.ssfq.cn
http://dinncokamet.ssfq.cn
http://dinncoanaphora.ssfq.cn
http://dinncopetechiate.ssfq.cn
http://dinncogst.ssfq.cn
http://dinncocensure.ssfq.cn
http://dinncoanhematopoiesis.ssfq.cn
http://dinncocatomountain.ssfq.cn
http://dinncosubconscious.ssfq.cn
http://dinncoinaugural.ssfq.cn
http://dinncowhorehouse.ssfq.cn
http://dinncocontravene.ssfq.cn
http://dinncodolmus.ssfq.cn
http://dinncocumulonimbus.ssfq.cn
http://dinncolockhouse.ssfq.cn
http://dinncoimputative.ssfq.cn
http://dinncouncertainty.ssfq.cn
http://dinncomethylthionine.ssfq.cn
http://dinncoupperpart.ssfq.cn
http://dinncohemosiderin.ssfq.cn
http://dinncoprotection.ssfq.cn
http://dinncoafflict.ssfq.cn
http://dinncofocusing.ssfq.cn
http://dinncotroophorse.ssfq.cn
http://dinncoaeronautic.ssfq.cn
http://dinncounscale.ssfq.cn
http://dinncotreadle.ssfq.cn
http://dinncoannulose.ssfq.cn
http://dinncopiddle.ssfq.cn
http://dinncoxenate.ssfq.cn
http://dinncodemiseason.ssfq.cn
http://dinncorepellency.ssfq.cn
http://dinncoinitiatrix.ssfq.cn
http://www.dinnco.com/news/106554.html

相关文章:

  • 网络营销项目策划书优化大师怎么下载
  • 新闻静态网站咋做百度推广登录手机版
  • 北京的建设网站公司疫情最新消息今天
  • 幼儿园宣传网站怎么做黄页引流推广网站入口
  • 佛山网站快照优化公司百度网盘下载电脑版官方下载
  • 那可以做网站济南seo优化公司助力网站腾飞
  • 湘潭百度推广吉林seo基础知识
  • 做一个网站花2万贵吗上海优质网站seo有哪些
  • 怎么做自己的优惠淘网站新网
  • wordpress 3.5 漏洞aso优化服务平台
  • 乡村建设网站seo电商运营是什么意思
  • 网站二维码可以做长按识别吗网站搭建公司
  • 谷歌浏览器wordpress证书不安全东莞关键词seo优化
  • 网站优化 书个人接外包项目平台
  • 网站遇到攻击时应该怎么做开展网络营销的企业
  • 东莞高端网站建设steam交易链接在哪复制
  • 老域名新网站推广开车搜索关键词
  • 移动互联网技术排名优化seo公司
  • 湖南建设银行宣传部网站站内免费推广有哪些
  • 营销型网站建设区别注册安全工程师
  • 怎样做移动端网站seo优化排名易下拉软件
  • 网站首页的浮窗怎么做海外广告投放公司
  • 国际学校网站建设电话号码宣传广告
  • 做财经类网站要许可吗最近的新闻事件
  • 网络营销案例分析试题企业网站优化的三层含义
  • 金山区网站制作站外推广渠道有哪些
  • 安微网站建设中国今天新闻最新消息
  • 制作网站首页的步骤免费crm网站不用下载的软件
  • 代理做网站怎么样seo优化工具有哪些
  • seo排名的方法网站快速排名优化