博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
STL 清除模板容器 clear.h
阅读量:6911 次
发布时间:2019-06-27

本文共 845 字,大约阅读时间需要 2 分钟。

 
#pragma once#include "GeometricMacro.h"#include "GeometricEnum.h"#include "McGePoint2d.h"_GEOMETRIC_BEGINtemplate
inline bool clearvct(std::vector
& vctVal){ for(std::vector
::iterator p=vctVal.begin();p!=vctVal.end();++p) { delete static_cast
(*p); *p=NULL; } vctVal.clear(); return true;}template
inline bool clearlst(std::list
& lstVal){ for(std::list
::iterator p=lstVal.begin();p!=lstVal.end();++p) { delete static_cast
(*p); *p=NULL; } lstVal.clear(); return true;}template
inline bool clearmap(std::map
& mapVal){ for(std::map
::iterator p=mapVal.begin();p!=mapVal.end();++p) { delete static_cast
(p->second); static_cast
(p->second)=NULL; } mapVal.clear(); return true;}_GEOMETRIC_END
 

版权声明:本文博主原创文章,博客,未经同意不得转载。

你可能感兴趣的文章
linux 搜索并替换文件内容
查看>>
我的友情链接
查看>>
dns详解
查看>>
设备驱动
查看>>
How To Use Repadmin for Active Directory Troubleshooting
查看>>
安装 jupyter notebook编码出错问题
查看>>
我是怎样做到第一次写作职场类新媒体文章一遍过稿的?
查看>>
DNS基础
查看>>
linux系统启动流程(CentOS为例)
查看>>
Lintcode97 Maximum Depth Of BinaryTree solution 题解
查看>>
韩顺平.linux视频教程第7讲.j2ee环境.jdk.t
查看>>
邮箱数据库增长统计
查看>>
awk学习笔记之一BEGIN和END
查看>>
一套书读懂LTE!
查看>>
函数与模块间作用域的区别
查看>>
SQL Server扩展事件(Extended Events)-- 使用system_health默认跟踪会话监控死锁
查看>>
oc面向对象特性: 多态
查看>>
iOS开发4:UIStepper控件的简单使用
查看>>
pip安装报错:is not a supported wheel on this platform
查看>>
web部署
查看>>