1. boost::ptr_vector

#include <boost/ptr_container/ptr_vector.hpp>
#include <iostream> int main() {
boost::ptr_vector<int> v;
v.push_back(new int());
v.push_back(new int());
std::cout << v.back() << std::endl;
return ;
}

boost::ptr_vector knows that it stores dynamically allocated objects, member functions like back() return a reference to a dynamically allocated object and not a pointer. Thus, the example writes 2 to standard output.

2. boost:ptr_set 有顺序的容器

#include <boost/ptr_container/ptr_set.hpp>
#include <iostream> int main() {
boost::ptr_set<int> s;
s.insert(new int());
s.insert(new int());
std::cout << *s.begin() << std::endl;
return ;
}

输出: 1

3. additional containers include boost::ptr_deque, boost::ptr_list, boost::ptr_map, boost::ptr_unordered_set, boost::ptr_unordered_map

最新文章

  1. OC self = [super init] , 点语法 , @property
  2. 2分钟 windows下sublime text 3安装git插件:
  3. linux 强大的编辑器之vi
  4. powerdesigner 15 如何导出sql schema
  5. Java循环语句之 for
  6. 18、GPS技术
  7. Poj 2586 / OpenJudge 2586 Y2K Accounting Bug
  8. Cassandra1.2文档学习(17)—— CQL数据模型(上)
  9. SQLServer 在Visual Studio的连接方法
  10. 登录超时,给出提示跳到登录页面(ajax、导入、导出)
  11. gcc 编译的4个过程简单识记
  12. 通过rpm 安装MYSQL
  13. 新版TP-Link无线路由器怎么设置
  14. 下一个计划 : .NET/.NET Core应用性能管理系统
  15. case 函数的简单使用记录下
  16. qq截图存放在电脑的哪个文件夹
  17. pygame-KidsCanCode系列jumpy-part6-主角挂掉重新开始
  18. php+mysql 解决emoji问题
  19. MT【233】染色正方形
  20. Maven中的-D(Properties属性)和-P(Profiles配置文件)

热门文章

  1. 【leetcode】1023. Camelcase Matching
  2. 如何隐藏一个让人很难发现的bug?
  3. Linux配置postfix
  4. [CSP-S模拟测试]:v(hash表+期望DP)
  5. 如果遇到找不到元素如何处理? Exception in thread &quot;main&quot; org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {&quot;method&quot;:&quot;id&quot;,&quot;selector&quot;:&quot;investmentframe&quot;}
  6. jmeter添加自定义扩展函数之DoubleSum
  7. 用 Flask 来写个轻博客 (25) — 使用 Flask-Principal 实现角色权限功能
  8. delphi vlc 安装bug 处理编译错误"0" is an invalid value for the "DebugInformation" parameter of the "DCC"
  9. Java + selenium 元素定位(2)之By LinkText/PartialLinkText
  10. git使用记录三:查看日志