for_each 用法!
class MapTest:public CapTest
{
private:
set <string> MyTestContain;
typedef pair <string,int> myPairDef;
typedef map <string,int> myMapDef;
myMapDef MyMap1;
public:
MapTest();
~MapTest(){};
void OutPut();
friend void MyOutPut2(myPairDef thispair);
};
void MyOutPut2(MapTest::myPairDef thispair)
{
cout<<thispair.first;
}
void MapTest::OutPut()
{
std::for_each(MyMap1.begin(), MyMap1.end(), MyOutPut2);
cout << endl;
}
for_each 用法!的更多相关文章
- 匿名函数和for_each用法
匿名函数,C++11的 for_each 用法 #include <iostream> #include <algorithm> #include "testClas ...
- for_each用法
for_each()是个function template #include <algorithm>头文件说明 template<class _InIt, class _Fn1> ...
- CPP STL学习笔记
STL的概念 源地址 https://www.ev0l.art/index.php/archives/15/ <li> Iterator (迭代器)<li> Containe ...
- 《STL源码剖析》学习半生记:第一章小结与反思
不学STL,无以立.--陈轶阳 从1.1节到1.8节大部分都是从各方面介绍STL, 包括历史之类的(大致上是这样,因为实在看不下去我就直接略到了1.9节(其实还有一点1.8.3的内容)). 第一章里比 ...
- c++11的for新用法 (重新练习一下for_each)
看到手册的代码里面有个for的很奇怪的用法,用了一把 http://www.cplusplus.com/reference/unordered_set/unordered_set/insert/ ...
- C++11之for循环的新用法
C++使用如下方法遍历一个容器: #include "stdafx.h" #include<iostream> #include<vector> int m ...
- STL vector用法介绍
STL vector用法介绍 介绍 这篇文章的目的是为了介绍std::vector,如何恰当地使用它们的成员函数等操作.本文中还讨论了条件函数和函数指针在迭代算法中使用,如在remove_if()和f ...
- c++ bind1st 和 bind2nd的用法
std::bind1st 和 std::bind2nd将二元函数转换为一元函数,具体用法参加下面的代码. 代码介绍了两种使用方式,第一种是使用std::less和std::greater,第二种是使用 ...
- c++ algorithm 的用法
1 , accumulate()template<class _II, class _Ty> inline_Ty accumulate(_II _F, _II _L, _Ty _V){fo ...
随机推荐
- Nmap Snote
Title:Nmap Snote --2011-11-15 21:28 用Nmap上瘾了,怕以后忘记,也就记一下. Nmap -v -sS -n -p1-65535 IP Nmap -v -sS -p ...
- Oracle 序列(sequence)
序列是Oracle特有的,他可以维护一个自增的数字序列,通常从1开始增长,但可以设置. (1)创建序列: increment (2)使用序列: insert into student(sno,name ...
- 找出指定目录下,大于指定大小的文件(LINUX SHELL)
当前目录下: find ./ -size +2048k |xargs du -b|awk '{print $1/1024/1024 "M" $2}'|sort -n ...... ...
- Gridview中的数据导出到excel中
protected void btnExport_Click(object sender, EventArgs e) { //导出全部数据,取消分页 ...
- Java正则表达式详解教程
public class Test { private static Scanner scanner; public static void main(String[] args) { scanner ...
- 如何通过ftell和fseek来获取文件大小
#include <stdio.h> int main () { FILE * pFile=NULL; long size; pFile = fopen ("myfile.txt ...
- yii 使用 phpmailer发送邮件
原文链接 : http://www.yiiframework.com/extension/mailer/ 下载插件放在 :XXX/protected/extensions/ 作为一个普通的组建使用 ...
- css流式和弹性布局(未完)
(子容器%父容器)*100 png透明ie6中filter:progid:DXImageTransfornm.Microsoft.AlphaImageLoader( src='路径',sizingMe ...
- (转)基于企业级证书的IOS应用打包升级功能介绍
IOS应用程序升级流程介绍:IOS手机端应用程序需要升级时,打开服务器端html文件(本文为ucab.html文件)->点击在线安装->打开plist文件(本文中为ucab.plist文件 ...
- Sublime Text2 按shift键选择不了的问题
记录下来,免得以后忘了: 今天在Sublime Text 2装了一个ThinkPHP插件之后.发现按shift键+鼠标左键选择不了内容了.原因是ThinkPHP里的热键与系统的有冲突了,须要设置例如以 ...