//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <unordered_map>
// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
// class Alloc = allocator<pair<const Key, T>>>
// class unordered_multimap
// const_iterator find(const key_type& k) const;
#include <unordered_map>
#include <string>
#include <cassert>
#include "min_allocator.h"
int main()
{
{
typedef std::unordered_multimap<int, std::string> C;
typedef std::pair<int, std::string> P;
P a[] =
{
P(10, "ten"),
P(20, "twenty"),
P(30, "thirty"),
P(40, "fourty"),
P(50, "fifty"),
P(60, "sixty"),
P(70, "seventy"),
P(80, "eighty"),
};
const C c(std::begin(a), std::end(a));
C::const_iterator i = c.find(30);
assert(i->first == 30);
assert(i->second == "thirty");
i = c.find(5);
assert(i == c.cend());
}
#if __cplusplus >= 201103L
{
typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
min_allocator<std::pair<const int, std::string>>> C;
typedef std::pair<int, std::string> P;
P a[] =
{
P(10, "ten"),
P(20, "twenty"),
P(30, "thirty"),
P(40, "fourty"),
P(50, "fifty"),
P(60, "sixty"),
P(70, "seventy"),
P(80, "eighty"),
};
const C c(std::begin(a), std::end(a));
C::const_iterator i = c.find(30);
assert(i->first == 30);
assert(i->second == "thirty");
i = c.find(5);
assert(i == c.cend());
}
#endif
}

weixin_42653672
- 粉丝: 120
最新资源
- 【IOS应用源码】很精致的范围选择组件.zip
- 【IOS应用源码】很感恩---samplecode(end)归档 7.zip
- 【IOS应用源码】很炫的抽屉式侧边栏导航效果.zip
- 【IOS应用源码】很炫的底部导航.zip
- 【IOS应用源码】很炫的翻页效果.zip
- 【IOS应用源码】横向滚动的label.zip
- 【IOS应用源码】横条显示滚动的股票动态.zip
- 【IOS应用源码】黄色背景的警告提示弹出条.zip
- 【IOS应用源码】后台运行(Multitasking)以及本地通知(Local Notifications) 有图,有书,有代码,统一打包 BackgroundDemo(Beta4Fixed).zip
- 基于Matlab Simulink的风轮机发电系统多模块建模与仿真研究 v1.2
- 【IOS应用源码】华丽的创意和设计 26款经典iPhone开源应用.zip
- 【IOS应用源码】获取当前硬件可用内存的例子UIDevice.zip
- 【IOS应用源码】获取全球当前所有时区的当前时间TestTimeZone.zip
- 【IOS应用源码】加载器(当下载或加载缓存时候用的进度条).zip
- 【IOS应用源码】记事本界面.zip
- 【IOS应用源码】简单的google应用demo.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


