The concept Compare is a set of requirements expected by some of the standard
library facilities from the user-provided function object types.

The return value of the function call operation applied to an object of type Compare, when contextually
converted
 to bool,
yields true if
the first argument of the call appears before the second in the strict weak ordering relationinduced by this Compare type,
and false otherwise.

As with any BinaryPredicate,
evaluation of that expression is not allowed to call non-const member functions of the dereferenced iterators.

Requirements

The type T satisfies Compare if

Given

  • comp, an object of type Compare
  • equiv(a, b), an expression equivalent to !comp(a,
    b) && !comp(b, a)

The following expressions must be valid and have their specified effects

Expression Return type Requirements
comp(a,
b)
implicitly convertible to bool Establishes strict
weak ordering
 relation with the following properties

  • For all a, comp(a,a)==false
  • If comp(a,b)==true then comp(b,a)==false
  • if comp(a,b)==true and comp(b,c)==true then comp(a,c)==true
equiv(a,
b)
bool Establishes equivalence relationship with the following properties

  • For all a, equiv(a,a)==true.
  • If equiv(a,b)==true,
    then equiv(b,a)==true
  • If equiv(a,b)==true and equiv(b,c)==true,
    then equiv(a,c)==true

Note: comp induces a strict total ordering on the equivalence classes determined by equiv

C++ concepts: Compare的更多相关文章

  1. RS-232, RS-422, RS-485 Serial Communication General Concepts(转载)

    前面转载的几篇文章重点介绍了UART及RS-232.在工控领域除了RS-232以外,常用的串行通信还有RS-485.本文转载的文章重点介绍了RS-232.RS-422和RS-485. Overview ...

  2. CMUSphinx Learn - Basic concepts of speech

    Basic concepts of speech Speech is a complex phenomenon. People rarely understand how is it produced ...

  3. TortoiseGit 文件比对工具使用 Beyond Compare 和 DiffMerge

    TortoiseGit 内置的文件比对工具是 TortoiseMerge,用于文件比对和解决冲突合并,TortoiseGit 还支持外部的比对工具使用,比如 Beyond Compare 和 Diff ...

  4. Git小技巧 - 指令别名及使用Beyond Compare作为差异比较工具

    前言 本文主要写给使用命令行来操作Git的用户,用于提高Git使用的效率.至于使用命令还是GUI(Tortoise Git或VS的Git插件)就不在此讨论了,大家根据自己的的喜好选择就好.我个人是比较 ...

  5. 使用Red Gate Sql Data Compare 数据库同步工具进行SQL Server的两个数据库的数据比较、同步

    Sql Data Compare 是比较两个数据库的数据是否相同.生成同步sql的工具. 这一款工具由Red Gate公司出品,我们熟悉的.NET Reflector就是这个公司推出的,它的SQLTo ...

  6. 使用Red Gate Sql Compare 数据库同步工具进行SQL Server的两个数据库的结构比较、同步

    将测试版的项目同步(部署)到正式版的时候,两个数据库的结构比较与同步时,如果修改数据库的时候没有记录好修改了那些表,很难将两个数据库进行同步 RedGate Sql Compare使用简介说明: 1. ...

  7. [LeetCode] Compare Version Numbers 版本比较

    Compare two version numbers version1 and version1.If version1 > version2 return 1, if version1 &l ...

  8. C# IComparable接口、IComparer接口和CompareTo(Object x)方法、Compare()方法

    在项目中经常会用到字符串比较,但是有时候对字符串的操作比较多,规则各异.比如有的地方我们需要用排序规则,有的地方需要忽略大小写,我们该如何写一个比较容易操作的比较方法呢?重新实现IComparer接口 ...

  9. 【leetcode】Compare Version Numbers

    题目描述: Compare two version numbers version1 and version2. If version1 > version2 return 1, if vers ...

随机推荐

  1. 《JS权威指南学习总结--8.4 作为值的函数》

    内容要点:   函数可以定义,也可以调用,这是函数最重要的特性.函数定义和调用是JS的词法特性,对于其他大多数编程语言来说也是如此.然而在JS中,函数不仅仅是一种语法,也是值,也就是说,可以将函数赋值 ...

  2. JS复习:第七章

    第七章  函数表达式 一.定义函数的方式有两种:函数声明和函数表达式. 1.函数声明: function functionName(arg0 , arg1 , arg2){ //函数体... } 函数 ...

  3. c# listview的使用

    C#向listview中添加项

  4. java 导出excel(简单案例)

    public class Student { private int id; private String name; private int age; private Date birth; pub ...

  5. POJ 2054 Color a Tree#贪心(难,好题)

    题目链接 代码借鉴此博:http://www.cnblogs.com/vongang/archive/2011/08/19/2146070.html 其中关于max{c[fa]/t[fa]}贪心原则, ...

  6. Unity开发Oculus游戏

    1.下载Oculus对应自己操作系统的SKD&RunTime 下载地址 我这里是window系统,下载的是0.6.0.0版本的 2.安装RunTime,电脑右下角状态栏会出现一个小眼睛表示安装 ...

  7. createThread和_beginthreadex区别

    摘自:http://blog.csdn.net/morewindows/article/details/7421759 CreateThread()函数是Windows提供的API接口,在C/C++语 ...

  8. web小技巧

    如内容超出单元格,则隐藏style="TABLE-LAYOUT: fixed" 让弹出窗口总是在最上面: <body onblur="this.focus();&q ...

  9. Chapter 16_4 私密性

    在Lua面向对象编程的基础设计当中,没有提供私密性机制.但是可以用其他方法实现,从而获得对象的访问控制. 这种实现不常用,作为兴趣爱好,只做基本了解. 基本做法是:通过两个table来表示一个对象.一 ...

  10. python paramiko模拟ssh登录,实现sftp上传或者下载文件

    Python Paramiko模块的安装与使用详解 paramiko是短链接,不是持续链接,只能执行你设定的shell命令,可以加分号执行两次命令. http://www.111cn.net/phpe ...