#include<iostream>
#include <set>
using namespace std;
template <class T>
class RuntimeCmp
{
public:
enum cmp_mode {normal,reverse};
private:
cmp_mode m_mode;
public:
RuntimeCmp(cmp_mode m = normal):m_mode(m){};
bool operator () (const T& t1,const T& t2)
{
return m_mode == normal ? t1 < t2 : t1>t2;
}
bool operator == (const RuntimeCmp& rc)
{
return m_mode = rc.m_mode;
}
}; typedef std::set<int,RuntimeCmp<int>> IntSet; int _tmain(int argc, int argv[])
{
IntSet intSet;
intSet.insert();
intSet.insert();
intSet.insert();
int aa = ; } set是使用树结构来实现的。

最新文章

  1. 来自 Thoughtram 的 Angular 2 系列资料
  2. 大型网站一致性的基础理论---CAP/BASE
  3. Smarty 配置文件的读取
  4. android 串口调试
  5. delphi 菜单的项目是否可用
  6. javascript editor
  7. wamp配置虚拟主机
  8. JVM监控概述(图文)
  9. 华硕 F1A55-M LX3系列跳线图
  10. Python(2)深入Python函数定义
  11. 三十七、小程序页面跳转传参参数值为url时参数丢失
  12. 【安全性测试】利用反编译查看对应activity的方法采用hook技术绑定劫持_入门
  13. 背水一战 Windows 10 (115) - 后台任务: 通过 toast 激活后台任务, 定时激活后台任务
  14. Quartz Cron表达式详解
  15. OO博客作业1:第1-3周作业总结
  16. JAVA深入研究——Method的Invoke方法(转)
  17. python 的正则表达式
  18. Go语言_range(范围)理解
  19. String int 相互转换
  20. 为什么推荐你用 Kotlin语言?

热门文章

  1. 如何用jar命令生成可执行的jar文件
  2. Android 性能优化 SparseArray【转载】
  3. winform clickonce在线安装
  4. 吴裕雄 21-MySQL 正则表达式
  5. &#39;Could not find first log file name in binary log index file&#39;的解决办法
  6. ROC,AUC,Precision,Recall,F1的介绍与计算(转)
  7. CSS 盒子大小
  8. @Component单例与并发(未解决)
  9. idea 设置 转自 https://www.cnblogs.com/jajian/p/8136672.html
  10. centos7 关闭 防火墙