// constructing sets
#include <iostream>
#include <set>
#include <string.h> bool fncomp (int lhs, int rhs) {return lhs<rhs;} struct classcomp {
bool operator() (const int& lhs, const int& rhs) const
{return lhs<rhs;}
}; int main ()
{
std::set<int> first; // empty set of ints int myints[]= {,,,,};
std::set<int> second (myints,myints+); // range std::set<int> third (second); // a copy of second std::set<int> fourth (second.begin(), second.end()); // iterator ctor. std::set<int,classcomp> fifth(second.begin(), second.end()); // class as Compare std::set<int>::reverse_iterator rit;
for (rit=fifth.rbegin(); rit != fifth.rend(); ++rit)
std::cout << ' ' << *rit; //bool(*fn_pt)(int,int) = fncomp;
//std::set<int,bool(*)(int,int)> sixth (fn_pt); // function pointer as Compare //std::cout<<strcmp("abc", "ab")<<std::endl; return ;
}

最新文章

  1. shiro 实现单用户登录,一个用户同一时刻只能在一个地方登录
  2. [普通平衡树treap]【学习笔记】
  3. MVC 分页
  4. 使用所见即所得文本编辑器编辑文本存入数据库后通过ajax获取服务器json_encode的数据到前台,文本内容上边的html标签不解析
  5. LESSCSS的几点摘要
  6. 遍历map的四方方法
  7. Python常用排序算法
  8. 多个版本的Python如何设置不冲突
  9. 基于struts2、hibernate、spring、shiro、MySQL的项目开发
  10. vue 开发微信小程序
  11. 使用Struts时,JSP中如何取得各个会话中的参数值?
  12. 网络对抗课题4.3.1 SQL注入原理与实践
  13. 每日scrum--No.1
  14. Python类总结-封装(Property, setter, deleter)
  15. hdu 5443 The Water Problem(长春网络赛——暴力)
  16. Java面向对象之异常(自定义异常)
  17. 293. Flip Game只翻转一步的加减号翻转游戏
  18. 【转载】BootStrap表格组件bootstrap table详解
  19. python tensorflow方法手记
  20. Node.js函数介绍(参数为一个函数)

热门文章

  1. 【Unity3D】【NGUI】UIRect的Anchor的使用
  2. response.Close、response.End、response.Flush区别
  3. CodeForces 501B Misha and Changing Handles(STL map)
  4. JS JavaScript实现杨辉三角
  5. 核心动画(UIView封装动画)-转
  6. 通过匿名管道获取CMD运行结果
  7. ABAP术语-Company Code
  8. Vmware+CentOs7+共享目录
  9. 关于J2EE里面getContextPath()和getRealPath()的区别
  10. JavaScript -- 继承与原型链