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 用法!的更多相关文章

  1. 匿名函数和for_each用法

    匿名函数,C++11的 for_each 用法 #include <iostream> #include <algorithm> #include "testClas ...

  2. for_each用法

    for_each()是个function template #include <algorithm>头文件说明 template<class _InIt, class _Fn1> ...

  3. CPP STL学习笔记

    STL的概念 源地址  https://www.ev0l.art/index.php/archives/15/ <li> Iterator (迭代器)<li> Containe ...

  4. 《STL源码剖析》学习半生记:第一章小结与反思

    不学STL,无以立.--陈轶阳 从1.1节到1.8节大部分都是从各方面介绍STL, 包括历史之类的(大致上是这样,因为实在看不下去我就直接略到了1.9节(其实还有一点1.8.3的内容)). 第一章里比 ...

  5. c++11的for新用法 (重新练习一下for_each)

    看到手册的代码里面有个for的很奇怪的用法,用了一把    http://www.cplusplus.com/reference/unordered_set/unordered_set/insert/ ...

  6. C++11之for循环的新用法

    C++使用如下方法遍历一个容器: #include "stdafx.h" #include<iostream> #include<vector> int m ...

  7. STL vector用法介绍

    STL vector用法介绍 介绍 这篇文章的目的是为了介绍std::vector,如何恰当地使用它们的成员函数等操作.本文中还讨论了条件函数和函数指针在迭代算法中使用,如在remove_if()和f ...

  8. c++ bind1st 和 bind2nd的用法

    std::bind1st 和 std::bind2nd将二元函数转换为一元函数,具体用法参加下面的代码. 代码介绍了两种使用方式,第一种是使用std::less和std::greater,第二种是使用 ...

  9. c++ algorithm 的用法

    1 , accumulate()template<class _II, class _Ty> inline_Ty accumulate(_II _F, _II _L, _Ty _V){fo ...

随机推荐

  1. findstr 只搜寻指定文件类型

    Title:findstr 只搜寻指定文件类型 --2012-05-04 09:27 findstr /i /m /S /C:"关键字"  *.php *.asp *.jsp

  2. android反编译工具 ApkDec-Release-0.1

    (1 )使用帮助    1. 选择 all  全部编译内容包括jar .xml .及其他资源文件    2. 选择 jar  只反编译并打成jar 包    3. 反编译后你可以使用jd-gui.ex ...

  3. Windows开发中一些常用的辅助工具

    经常有人问如何快速的定位和解决问题,很多时候答案就是借助工具, 记录个人Windows开发中个人常用的一些辅助工具.   (1) Spy++ 相信windows开发中应该没人不知道这个工具, 我们常用 ...

  4. 神舟飞船上的计算机使用什么操作系统,为什么是自研发不是 Linux?

    中国航天用的SpaceOS主要内容是仿造美国风河系统公司的VxWorks653(653是产品名,并非版本号). 先解释为什么用这个系统不用Linux: 航天器的内存和CPU都非常弱,弱到什么程度呢:天 ...

  5. shell中使用sqlplus及调试相关

    五.为了安全要求每次执行shell都手工输入密码$ vi test5.sh #!/bin/bashecho -n "Enter password for u_test:"read ...

  6. vijos国庆节模拟赛之繁星春水

    A.闪烁的繁星 题目:https://vijos.org/p/1881 题解:貌似做过小白逛公园或者序列操作都可以秒出吧,就是pushup函数比较麻烦,不过仔细想一想就知道了. 代码: #includ ...

  7. hdu1166敌兵布阵

    敌兵布阵 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submi ...

  8. Linux查找yum安装软件在系统中路径

    find文件查找http://www.ruanyifeng.com/blog/2009/10/5_ways_to_search_for_files_using_the_terminal.html

  9. IOS XMPP

    http://www.cnblogs.com/lmyhao/p/4120616.html

  10. HDU 1874-畅通project续(最短路Dijkstra+优先队列)

    畅通project续 Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...