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. python:os.path

    __file__ " here = os.path.abspath(os.path.dirname(__file__)) 当"print os.path.dirname(__fil ...

  2. hdu_2476_String painter(区间DP)

    题目链接:hdu_2476_String painter 题意: 有a,b两字符串,现在你有一个刷子,每次可以任选一个区间,使这个区间变成你想要的字符,现在让你将a变成b,问最少刷多少次 题解: 考虑 ...

  3. POJ 2039 To and Fro

    To and Fro Description Mo and Larry have devised a way of encrypting messages. They first decide sec ...

  4. Storm常见问题处理

    错误1:发布topologies到远程集群时,出现Nimbus host is not set异常.异常内容如下所示: [root@xop-dev-a bin]# ./storm jar /home/ ...

  5. LeetCode OJ 154. Find Minimum in Rotated Sorted Array II

    Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed? Would ...

  6. Linux CPU 核数检查脚本

    #!/bin/bash physicalNumber=0 coreNumber=0 logicalNumber=0 HTNumber=0 logicalNumber=$(grep "proc ...

  7. RegOpenKey(注册表定位器) 1.5 中文免费绿色版

    软件名称: RegOpenKey(注册表定位器) 1.5 中文免费绿色版 软件语言: 简体中文 授权方式: 免费软件 运行环境: Win7 / Vista / Win2003 / WinXP / Wi ...

  8. mysql建表设置两个默认CURRENT_TIMESTAMP的技巧

    转载:http://blog.163.com/user_zhaopeng/blog/static/166022708201252323942430/   业务场景: 例如用户表,我们需要建一个字段是创 ...

  9. linux重新部署mysql和tomcat时乱码问题

    mysql解决方法 vim /etc/my.cnf [client]default-character-set=utf8 [mysqld]default-storage-engine=INNODBch ...

  10. 移动端解决input focus后键盘弹出,高度被挤压的问题

    //解决弹出键盘页面高度变化bug var viewHeight = window.innerHeight; //获取可视区域高度 $("input").focus(functio ...