Map

2023-11-13

1、说明:系统根据C++ Reference学习下STL--> Map

2、Map:Maps are associative containers that store elements formed by a combination of a key value and a mapped value, following a specific order. 就是说一个key(关键)值映射一个mapped(映射)值,并且按照欧一定的顺序排列。

(1) key value标记一个一个元素,mapped value通常用来key value对应的内容

(2) Key value和Mapped Value的类型可以不同,一般由

typedef pair<const Key, T> value_type来绑定。

3、Map的基本成员函数

(1) map::at  --> Returns a reference to the mapped value of the element identified with key k

  1. map<string,int> mymap = {  
  2.     {"alpha", 0},  
  3.     {"beta", 0},  
  4.     {"gamma", 0}};  
  5.   
  6.   
  7. mymap.at("alpha") = 10;  
  8. mymap.at("beta") = 20;  
  9. mymap.at("gamma") = 30;  
  10.   
  11. for(auto &x: mymap){  
  12.     cout << x.first << ": " << x.second << endl;  
  13. }  

(2)map::begin  --> Returns an iterator referring to the first element in the map container.

  1. map<charint> mymap;  
  2. map<charint>::iterator it;  
  3.   
  4. mymap['b'] = 100;  
  5. mymap['a'] = 200;  
  6. mymap['c'] = 300;  
  7.   
  8. for(map<charint>::iterator it = mymap.begin(); it != mymap.end(); it ++)  
  9. {  
  10.     cout << it->first << " => " << it->second << endl;  
  11. }  

(3) map ::cbegin  -->  Returns a  const_iterator  pointing to the first element in the container.

  1. map<charint> mymap;  
  2.   
  3. mymap['b'] = 100;  
  4. mymap['a'] = 200;  
  5. mymap['c'] = 300;  
  6.   
  7. cout << "mymap contains:\n";  
  8. for(auto it = mymap.cbegin(); it != mymap.cend(); it ++)  
  9. {  
  10.     cout << "[" << (*it).first << ": " << (*it).second << "]\n";  
  11. }  

     (4)map::clear  --> Removes all elements from the map container (which are destroyed), leaving the container with a size of 0.

       (5)map::count  --> Searches the container for elements with a key equivalent to k and returns the number of matches.  Map中的所有element都是唯一的。

  1. map<charint> mymap;  
  2. char c;  
  3.   
  4. mymap['a'] = 101;  
  5. mymap['b'] = 202;  
  6. mymap['f'] = 303;  
  7.   
  8. for(c = 'a'; c < 'h'; c ++)  
  9. {  
  10.     cout << c;  
  11.     if(mymap.count(c) > 0)  
  12.         cout << " is an element of mymap.\n";  
  13.     else cout << " is not an element of mymap.\n";  
  14. }  
      (6)map::crbegin  --> A const_reverse_iterator to the reverse beginning of the sequence.

和cbegin的调用是一致的。

     (7)map::emplace  --> Inserts a new element in the map if its key is unique. This new element is constructed in place using args as the arguments for the construction of a value_type (which is an object of a pair type).  如果键值是唯一的,则插入成功。如果插入成功,则会依照原有的顺序插入到map中

  1. map<charint> mymap;  
  2. mymap.emplace('x', 100);  
  3. mymap.emplace('y', 200);  
  4. mymap.emplace('z', 300);  
  5.   
  6. cout << "mymap contains:\n";  
  7. for(auto &x: mymap){  
  8.     cout << "[" << x.first << ", " << x.second << "]\n";  
  9. }  

         (8)map::emplace_hint   --> Inserts a new element in the map if its key is unique, with a hint on the insertion position. This new element is constructed in place using args as the arguments for the construction of a value_type (which is an object of a pairtype).

  1. map<charint> mymap;  
  2. auto it = mymap.end();  
  3.   
  4. it = mymap.emplace_hint(it, 'b', 10);  
  5. mymap.emplace_hint(it, 'a', 12);  
  6. mymap.emplace_hint(mymap.end(), 'c', 14);  
  7.   
  8. cout << "mymap contains: ";  
  9. for(auto &x: mymap)  
  10.     cout << "[" << x.first << ", " << x.second << endl;  
       (9)map::empty  -->  Returns whether the  map  container is empty (i.e. whether its  size  is  0 ).


       (10)map::equal_range  --> Returns the bounds of a range that includes all the elements in the container which have a key equivalent to k.

  1. map<charint> mymap;  
  2. mymap['a'] = 10;  
  3. mymap['b'] = 20;  
  4. mymap['c'] = 30;  
  5.   
  6. pair<map<charint>::iterator, map<charint>::iterator> ret;  
  7. ret = mymap.equal_range('a');  
  8.   
  9. cout << "lower bound points to: ";  
  10. cout << ret.first->first << " => " << ret.first->second << endl;  
  11. cout << "upper bound points to: ";  
  12. cout << ret.second->first << " => " << ret.second->second << endl;  
        (11)map::erase  --> Removes from the map container either a single element or a range of elements ([first,last)).

  1. map<charint> mymap;  
  2. map<charint>::iterator it;  
  3.   
  4. mymap['a'] = 10;  
  5. mymap['b'] = 20;  
  6. mymap['c'] = 30;  
  7. mymap['d'] = 40;  
  8. mymap['e'] = 50;  
  9. mymap['f'] = 60;  
  10.   
  11. it = mymap.find('b');  
  12. mymap.erase(it);        //erasing by iterator, erase b  
  13.   
  14. mymap.erase('c') ;       //erasing by key, erase c  
  15.   
  16. it = mymap.find('e');  
  17. mymap.erase(it, mymap.end()) ;  //erasing by range, erase e, f  
  18.   
  19. //输出a d  
  20. for(it = mymap.begin(); it != mymap.end(); ++ it)  
  21.     cout << it->first << " => " << it->second << endl;  
      (12)map::find  --> Searches the container for an element with a key equivalent to k and returns an iterator to it if found, otherwise it returns an iterator to map::end.

  1. std::map<char,int> mymap;  
  2. std::map<char,int>::iterator it;  
  3.   
  4. mymap['a']=50;  
  5. mymap['b']=100;  
  6. mymap['c']=150;  
  7. mymap['d']=200;  
  8.   
  9. it=mymap.find('b');  
  10. mymap.erase (it);  
  11. mymap.erase (mymap.find('d'));  
  12.   
  13. // print content:  
  14. std::cout << "elements in mymap:" << '\n';  
  15. std::cout << "a => " << mymap.find('a')->second << '\n';  
  16. std::cout << "c => " << mymap.find('c')->second << '\n';  

      (13)map::get_allocate  --> Returns a copy of the allocator object associated with the map.

  1. int psize;  
  2. map<charint> mymap;  
  3. pair<const charint> *p;  
  4.   
  5. //allocate an array of 5 elements using mymap's allocater.  
  6. p = mymap.get_allocator().allocate(5);  
  7.   
  8. //assign some values to array  
  9. psize = sizeof(map <charint>::value_type) * 5;  
  10. cout << "the allocated array has a size of " << psize << " bytes\n";  
  11. mymap.get_allocator().deallocate(p, 5);  

      (14)map::insert  --> Extends the container by inserting new elements, effectively increasing the container size by the number of elements inserted.  插入时会检查是否已经存在和当前键值一样的元素。

  1. map<charint> mymap;  
  2.   
  3. //first insert function version(single parameter)  
  4. mymap.insert(pair<charint>('a', 200));  
  5. mymap.insert(pair<charint>('z', 200));  
  6.   
  7. pair<map<charint>::iterator, bool> ret;  
  8.   
  9. ret = mymap.insert(pair<charint>('z', 500));  
  10. if(ret.second == false){  
  11.     cout << "element '" << ret.first->first << "' already exists";  
  12.     cout << " with a value of " << ret.first->second << endl;  
  13. }  
  14.   
  15. //second insert function version(with hint position)  
  16. map<charint>::iterator it = mymap.begin();  
  17. mymap.insert(it, pair<charint>('b', 300));  
  18. mymap.insert(it, pair<charint>('c', 400));  
  19.   
  20. //third insert function version(range insertion);  
  21. map<charint> anothermap;  
  22. anothermap.insert(mymap.begin(), mymap.find('c'));  
  23.   
  24. //showing contents  
  25. cout << "mymap contains:\n";  
  26. for(it = mymap.begin(); it != mymap.end(); ++it)  
  27.     cout << it->first << " => " << it->second << endl;  
  28.   
  29. cout << "anothermap contains:\n";  
  30. for(it = anothermap.begin(); it != anothermap.end(); ++ it)  
  31.     cout << it->first << " => " << it->second << endl;  

     (15)map::key_comp  --> Returns a copy of the comparison object used by the container to compare keys.

  1. map<charint> mymap;  
  2.   
  3. map<charint>::key_compare mycomp = mymap.key_comp();  
  4. mymap['b'] = 400;  
  5. mymap['e'] = 500;  
  6. mymap['f'] = 300;  
  7. mymap['a'] = 100;  
  8.   
  9. cout << "mymap contains:\n";  
  10. //key value of last element  
  11. char highest = mymap.rbegin()->first;  
  12.   
  13. map<charint>::iterator it = mymap.begin();  
  14. do{  
  15.     cout << it->first << " => " << it->second << endl;  
  16. }while(mycomp((*it ++).first, highest));  
  17.   
  18. cout << endl;  


     (16)map::lower_bound  -> Returns an iterator pointing to the first element in the container whose key is not considered to go before k (i.e., either it is equivalent or goes after).  he mapcontains an element with a key equivalent to k: In this case, lower_bound returns an iterator pointing to that element, whereas upper_bound returns an iterator pointing to the next element.

  1. map<charint> mymap;  
  2. map<charint>::iterator itlow, itup;  
  3.   
  4. mymap['a'] = 20;  
  5. mymap['b'] = 40;  
  6. mymap['c'] = 60;  
  7. mymap['d'] = 80;  
  8. mymap['e'] = 100;  
  9.   
  10. //itlow points to b  
  11. itlow = mymap.lower_bound('a');  
  12. //itup points to e(not 'd')  
  13. itup = mymap.upper_bound('d');  
  14.   
  15. //erase [itlow, itup)  
  16. mymap.erase(itlow, itup);  
  17.   
  18. for(map<charint>::iterator it = mymap.begin(); it != mymap.end(); ++ it)  
  19. {  
  20.     cout << it->first << " => " << it->second << endl;  
  21. }  
      (17)map::max_size  --> Returns the maximum number of elements that the map container can hold.
  1. map<intint> mymap;  
  2.   
  3. cout << mymap.max_size() << endl;  
  4. if(mymap.max_size() > 1000){  
  5.     for(int i = 0; i < 1000; i ++)  
  6.         mymap[i] = 0;  
  7.     cout << "The map contains 1000 elements" << endl;;  
  8. }  
  9. else cout << "The map could not hold 1000 elements." << endl;  
   

   (18)map::operator=  --> Assigns new contents to the container, replacing its current content.

  1. map<charint> first;  
  2. map<charint> second;  
  3.   
  4. first['x'] = 8;  
  5. first['y'] = 16;  
  6. first['z'] = 32;  
  7.   
  8. second = first;  
  9. second.insert(pair<charint>('a', 100));  
  10. first = second;  
  11.   
  12. cout << "Size of first: " << first.size() << endl;  
  13. cout << "Size of second: " << second.size() << endl;  
  14.   
  15. first = map<charint>();  
  16. cout << "Size of first: " << first.size() << endl;  
  17. cout << "Size of second: " << second.size() << endl;  


    (19)map::operator[]  -->  A reference to the mapped value of the element with a key value equivalent to  k .

  1. map<char, string> mymap;  
  2.   
  3. mymap['a'] = "an element";  
  4. mymap['b'] = "another elment";  
  5. mymap['c'] = mymap['b'];  
  6.   
  7. cout << "mymap['a'] is " << mymap['a'] << endl;  
  8. cout << "mymap['b'] is " << mymap['b'] << endl;  
  9. cout << "mymap['c'] is " << mymap['c'] << endl;  
  10.   
  11. cout << "mymap now contains " << mymap.size() << endl;  

    (20)map::rbegin  -->  Returns a  reverse iterator  pointing to the last element in the container (i.e., its  reverse beginning ).

  1. map<charint> mymap;  
  2.   
  3. mymap['x'] = 100;  
  4. mymap['y'] = 200;  
  5. mymap['z'] = 300;  
  6.   
  7. map<charint>::reverse_iterator rit;  
  8. for(rit=mymap.rbegin(); rit != mymap.rend(); ++rit){  
  9.     cout << rit->first << " => " << rit->second << endl;  
  10. }  


    (21)map::size  ->  Returns the number of elements in the  map  container.

  

    (22)map::value_comp  --> Returns a comparison object that can be used to compare two elements to get whether the key of the first one goes before the second.


    (23)map::swap  --> Exchanges the content of the container by the content of x, which is another map of the same type. Sizes may differ.  需要是同种类型的

  1. map<charint> foo, bar;  
  2.   
  3. foo['x'] = 100;  
  4. foo['y'] = 200;  
  5.   
  6. bar['a'] = 11;  
  7. bar['b'] = 22;  
  8. bar['c'] = 33;  
  9.   
  10. foo.swap(bar);  
  11.   
  12. cout << "foo contains: \n";  
  13. for(map<charint>::iterator it = foo.begin(); it != foo.end(); ++it)  
  14.     cout << it->first << " => " << it->second << endl;  
  15.   
  16. cout << "bar contains: \n";  
  17. for(map<charint>::iterator it = bar.begin(); it != bar.end(); ++it)  
  18.     cout << it->first << " => " << it->second << endl;  
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Map 的相关文章

  • 学历不应该成为“枷锁”

    孔乙已是鲁迅笔下人物 穷困流倒还穿着象征读书人的长衫 迁腐 麻木 最近 大家自我调佩是 当代孔乙己 学历成为思想负担 找工作时高不成低不就 你可以从以下几个角度说说你对看法 一 你认为社会对于学历和职业之间的关系认知是怎样的 首先我认为社会
  • PowerDesigner中显示name, code,comment的解决方法 修正脚本,执行不会重复添加comment...

    Option Explicit ValidationMode True InteractiveMode im Batch Dim mdl the current model get the current active model Set
  • 虚拟机内搭建CTFd平台搭建及CTF题库部署,局域网内机器可以访问

    一 虚拟机环境搭建 1 安装docker git docker compose ubuntu sudo apt get update 更新系统 sudo apt get y install docker io 安装docker sudo a
  • zxing解析二维码demo

    源文件 cpp include funset hpp include
  • pvr 与 png 的内存占用

    原文链接 http blog sina com cn s blog 6fbe210701015j7z html Zwoptex 生成的 spritesheet 除了可以导出 png 格式的图片外还有 pvr 格式 pvr 格式是 iOS 的
  • 微前端乾坤的实现以及注意事项

    微前端乾坤 微前端乾坤 主应用 子应用 主应用配置 子应用配置 问题 微前端乾坤 qiankun 是一个基于 single spa 的微前端实现库 拥有的特点 JS沙箱 样式隔离 元素隔离 数据通信 预加载 HTML Entry qiank
  • TortoiseGit(git客户端)清除删除账号密码

    在使用git bash 克隆项目时 出现了remote HTTP Basic Access denied错误 我的解决方法如下 删除后 就可以在克隆项目时 重新填写git账户和密码
  • 统计学常用概念:T检验、F检验、卡方检验、P值、自由度

    常用检验公示表 自由度概念 在统计模型中 自由度指样本中可以自由变动的变量的个数 当有约束条件时 自由度减少 自由度计算公式 自由度 样本个数 样本数据受约束条件的个数 即df n k df自由度 n样本个数 k约束条件个数 例 一组数据
  • QT发布软件

    Qt Creator 完成对release版本编译完成之后 就需要将exe文件发布出来 单纯的只拷贝exe文件是不能运行的 exe的运行需要依赖很多的Qt库 1 生成可以执行的exe文件 这里需要将exe文档放在一个单独创建的test文件夹
  • dos命令大全

    DOS命令 是DOS操作系统的命令 是一种面向磁盘的操作命令 主要包括目录操作类命令 磁盘操作类命令 文件操作类命令和其它命令 DOS命令不区分大小写 比如C盘的Program Files 在dos命令中完全可以用 progra 1 代替
  • log4c cmakelist.txt config.h

    cmake minimum required VERSION 2 8 12 project log4c add definitions DHAVE CONFIG H add definitions D CRT SECURE NO WARNI
  • 【pybind11入门】Windows下为Python创建C++扩展

    在Windows下使用pybind11为python添加C 扩展 这篇文章记录下整个安装 测试 使用流程 主要内容 1 安装编译工具 2 测试pybind11编译是否正常 3 使用pybind11创建C 扩展 4 在python中调用 1
  • 迈拓 kvm 切换热键

    4台电脑之间切换的时候 可以按KVM上面的开关 也可以用热键切换 热键的切换方法如下 1 切换到第一台电脑 Scroll Lock 1 第1台电脑 2 切换到第二台电脑 Scroll Lock 2 第2台电脑 3 切换到第三台电脑 Scro
  • JLink和ST-Link接口引脚介绍

    STM32F1系列 STM8S系列 PY32F003系列都用过好久了 但是对JLink和ST Link下载器认识 还是很肤浅的 有时候 需要自己接线 却不知道引脚定义 特整理如下 1 ST Link ST Link适合对象是STM8和STM
  • Markdown学习笔记

    这个是源代码 由于无法在markdown下直接显示 所以这里采用富文本格式 Markdown学习笔记 你好 2020 7 28 段落 间隔一或多行行表示一个回车 两者没有区别 这是没有产生的效果 天王盖地虎 宝塔镇河妖 这是有回车的效果 天
  • 若依框架修改Vue请求超时时间

    ruoyi ui gt src gt utils gt request js 修改request js下的 timeout 10000 单位 毫秒
  • 软件设计师笔记 2021年下半年

    软件设计师笔记 1 第一章 计算机知识 控制器包含 地址寄存器 S single M multiple I 指令流 Data 数据流 2 第二章
  • 【状态估计】基于UKF、AUKF的电力系统负荷存在突变时的三相状态估计研究(Matlab代码实现)

    欢迎来到本博客 博主优势 博客内容尽量做到思维缜密 逻辑清晰 为了方便读者 座右铭 行百里者 半于九十 本文目录如下 目录 1 概述 2 运行结果 3 参考文献 4 Matlab代码及数据 1 概述 基于UKF和AUKF的电力系统负荷存在突
  • ARM发布Cortex-X1,是为了向苹果自研A系列处理器发起冲击吗?

    对于Arm来说 2019年是伟大的一年 这一年ARM的Cortex内核依然是手机CPU领域的佼佼者 特别是Cortex A77 红极一时的高通骁龙865处理器采用的就是Cortex A77 据说采用骁龙865处理器的手机有70款之多 其中就
  • c语言文件处理中ab,C语言文件处理中wt是什么操作方式?

    匿名用户 1级 2013 04 25 回答 最常用的文件使用方式及其含义如下 1 r 为读而打开文本文件 不存在则出错 2 rb 为读而打开二进制文件 3 w 为写而打开文本文件 若不存在则新建 反之 则从文件起始位置写 原内容将被覆盖 4

随机推荐

  • 【中间件】Redis如何解决BigKey

    BigKey 的弊端 BigKey 需要解决 根源就在于 BigKey 会带来的问题 占用内存 因为 Redis 数据结构的底层数据结构 大 Key 会占用更多的内存空间 造成更大的内存消耗 单线程模型 因为 Redis 的通信依赖于 So
  • 一文看懂web服务器、应用服务器、web容器、反向代理服务器区别与联系

    我们知道 不同肤色的人外貌差别很大 而双胞胎的辨识很难 有意思的是Web服务器 Web容器 Web应用程序服务器 反向代理有点像四胞胎 在网络上经常一起出现 本文将带读者对这四个相似概念如何区分 Web服务器概念与基本原理 Web服务器的历
  • CSS基础之CSS文本属性

    文章目录 前言 1 color 2 text align 3 font size 4 text decoration 5 text indent 6 line height 7 文本属性总结 前言 CSS 文本属性可以设置文本的 外观 比如
  • 从同源政策到跨域解决方法

    一 同源政策 同源政策的目的 是为了保证用户信息的安全 防止恶意的网站窃取数据 所谓同源指的是协议 域名 端口相同 否则就会产生跨域问题 二 跨域 跨域问题主要分为三类 1 Cookie LocalStorage 和 IndexDB 无法读
  • 记一次jQuery EasyUI使用-Easyui combobox的使用方法

    开局附上最最最有用的官方文档 划重点 easyui使用手册 进入正题 现象 有这样一段代码 浏览器请求getSystemSignList方法有返回数据并且严格符合easyui的应答规范 一个json格式的list对象 tr td class
  • 大模型讲习班丨第四范式黄世宇:强化学习的发展历程与基于人类反馈的强化学习...

    人工智能研究与应用范式正经历一场剧变 越来越多的顶级团队和杰出人才纷纷加入这一变革浪潮 作为AI大模型科研先锋 智源研究院携手一批卓越的学者与工程师 致力于将尖端技术与经验传授给有潜力的学习者 通过高效的学习方式 让更多人能迅速融入这一重要
  • MobileNet网络结构详解

    下图展示了传统卷积与DW卷积的差异 在传统卷积中 每个卷积核的channel与输入特征矩阵的channel相等 每个卷积核都会与输入特征矩阵的每一个维度进行卷积运算 而在DW卷积中 每个卷积核的channel都是等于1的 每个卷积核只负责输
  • Python-安装库-图像处理库-cv2

    问题 在pycharm中搜索cv2库 发现没有版本 在网上查找资料 找到了类似官方文档的资料 提到了安装方法 https pypi org project opencv python description cv2介绍 CV2指的是Open
  • ERROR 1064 (42000): You have an error in your SQL syntax

    mysql使用load data infile导入数据 出现如下错误 root NoName 21 19 12 gt load data infile change csv into table change CHARACTER SET u
  • JAVA基础知识点大全之二

    1 泛型 1 1 泛型类 定义格式 修饰符 class 类名 lt 类型 gt 1 2 泛型方法 定义格式 修饰符 lt 类型 gt 返回值类型 方法名 类型 变量名 1 3 泛型接口 定义格式 修饰符 interface 接口名 lt 类
  • c/c++多线程编程(1):线程的创建

    参考资料 多线程和线程同步 C C 运行环境 wsl2 Ubuntu 20 04 vscode clangd xmake gcc9 4 0 1 创建线程 1 1 线程函数 每个线程都有一个属于自己的线程id id的类型为phtread t
  • 解决centos 8命令ip add无效问题

    之前用Xshell连接虚拟机一直正常 突然一台节点总是连不上 查询众多资料后 终于找到了问题所在 出错情况 输入命令 root node01 service NetworkManager start root node01 nmcli ne
  • 图腾柱电路工作原理

    图腾柱就是上下各一个晶体管 上管为NPN c极接正电源 下管为PNP e极接负电源 注意 是负电源 是地 两个b极接到一起 接输入 上管的e和下管的c接到一起 接输出 用来匹配电压 或者提高IO口的驱动能力 有几种图腾柱电路的变种 一种是两
  • Log4j2安全 JNDI漏洞 CVE-2021-44228

    Apache Log4j2是基于Java的日志记录工具 工具重写了Log4j框架 并且引入了大量丰富特性 该日志框架被大量用于业务系统开发 用来记录日志信息 大多数情况下 开发者可能会将用户输入导致的错误信息写入日志中 因该组件使用极为广泛
  • linux内核态发送tcp包,Linux内核发送构造数据包的方式

    本文欢迎自由转载 但请标明出处 并保证本文的完整性 作者 Godbach 日期 2009 09 01 一 构造数据包简析 这里并不详细介绍如何在内核中构造数据包 下文如有需要会在适当的位置进行分析 这里简单的分析讲一下内核态基于Netfil
  • 系统掌握数据结构8 树与二叉树 第二节

    树与二叉树 2节 1 线索二叉树的逻辑结构 2 线索二叉树的物理结构 3 中序线索二叉树 3 1 逻辑结构 3 2 代码实现 4 先序线索二叉树 5 后序线索二叉树 6 三叉链表的物理结构 7 先序线索二叉树的三叉链表存储实现 8 后序线索
  • 【转】C#操作sqlServer数据库

    转载地址 https blog csdn net weixin 42731241 article details 81172622 工具 vs2015 SqlServer 数据库的连接及打开关闭 VS2015建立一个c 的控制台应用程序 必
  • 10个 解放双手的 IDEA 插件,让你少写冤枉代码

    公众号关注 GitHubDaily 设为 星标 每天带你逛 GitHub 友情提示 插件虽好 可不要贪装哦 装多了会 卡 卡 卡 正经干活用的 分享一点自己工作中得心应手的 IDEA 插件 可不是在插件商店随随便便搜的 都经过实战检验 用过
  • 两种通过aop设置重试机制的方式

    注意 1 不要在同一个类中调用自定义的注解 如果controller调用 注解要放在service层 其他类 2 如果有配置aop扫描的包 不能只设置扫描control下的文件 方式一 controller层 RequestMapping
  • Map

    1 说明 系统根据C Reference学习下STL gt Map 2 Map Maps are associative containers that store elements formed by a combination of a