c语言中greater是什么意思,C++:greater和less

greater和less是xfunctional.h中的两个结构体,代码如下:

template

struct less

{ // functor for operator<

typedef _Ty first_argument_type;

typedef _Ty second_argument_type;

typedef bool result_type;

constexpr bool operator()(const _Ty& _Left, const _Ty& _Right) const

{ // apply operator< to operands

return (_Left < _Right);

}

};

template

struct greater

{ // functor for operator>

typedef _Ty first_argument_type;

typedef _Ty second_argument_type;

typedef bool result_type;

constexpr bool operator()(const _Ty& _Left, const _Ty& _Right) const

{ // apply operator> to operands

return (_Left > _Right);

}

};

greater表示内置类型从大到小排序,less表示内置类型从小到大排序。

随机推荐

第一次div1做出3道题

第一次div1做出3道题! 再接再厉! 哈利路亚!

LeetCode 344

Reverse String Write a function that takes a string as input and returns the string reversed. Exampl ...

CentOS 6&period;3 配置FTP

一.FTP的安装 .检测是否安装了FTP:[root@localhost ~]# rpm -q vsftpd 如果安装了会显示版本信息: [root@localhost ~]# vsftpd-2.0. ...

IDEA的优质使用博客资源

intelliJ idea 使用技巧&方法 IntelliJ IDEA 常用设置讲解 IntelliJ IDEA 详细图解最常用的配置 ,适合刚刚用的新人. IntelliJ IDEA 常见文 ...

fabric&period;js和高级画板

本文介绍fabric.js框架使用,以及使用fabricjs打造一个高级画板程序. 高级画板功能介绍 全局绘制颜色选择 护眼模式.网格模式切换 自由绘制 画箭头 画直线 画虚线 画圆/椭圆/矩形/直角 ...

codefroces 55D Beautiful numbers

[Description] 美丽数是指能被它的每一位非0的数字整除的正整数. [Input] 包含若干组数据,每组数据一行两个数n,m,表示求[n,m]之间的美丽数的个数. [output] 对于每组 ...

&commat;requestParamore与&commat;pathvariable的区别

http://localhost:8080/Springmvc/user/page.do?pageSize=3&pageNow=2 你可以把这地址分开理解,其中问号前半部分:http://lo ...

【翻唱】【你的名字MAD】爱你等于爱自己

http://video.yingtu.co/0/8f606e9b-9694-4d35-a0bf-730391a3ee12.mp4 [你的名字MAD]爱你等于爱自己-原唱翻唱 http://video ...

webapi 后台跳转 后台输出html和script

1.跳转 [HttpGet]public HttpResponseMessage LinkTo(){ HttpResponseMessage resp = new HttpResponseMessag ...

参数化SQL语句

避免SQL注入的方法有两种:一是所有的SQL语句都存放在存储过程中,这样不但可以避免SQL注入,还能提高一些性能,并且存储过程可以由专门的数据库管理员(DBA)编写和集中管理,不过这种做法有时候针对相 ...