Memory elements

This header defines general utilities to manage dynamic memory:

Allocators

allocator
Default allocator (class template )
allocator_arg 
Allocator arg (object )
allocator_arg_t 
Allocator arg type (class )
allocator_traits 
Allocator traits (class template )

Managed pointers

auto_ptr
Automatic Pointer [deprecated] (class template )
auto_ptr_ref
Reference to automatic pointer (class template )
shared_ptr 
Shared pointer (class template )
weak_ptr 
Weak shared pointer (class template )
unique_ptr 
Unique pointer (class template )
default_delete 
Default deleter (class template )

Functions and classes related to shared_ptr:

make_shared 
Make shared_ptr (function template )
allocate_shared 
Allocate shared_ptr (function template )
static_pointer_cast 
Static cast of shared_ptr (function template )
dynamic_pointer_cast 
Dynamic cast of shared_ptr (function template )
const_pointer_cast 
Const cast of shared_ptr (function template )
get_deleter 
Get deleter from shared_ptr (function template )
owner_less 
Owner-based less-than operation (class template )
enable_shared_from_this 
Enable shared_from_this (class template )

Uninitialized memory

Raw storage iterator:

raw_storage_iterator
Raw storage iterator (class template )

Temporary buffers:

get_temporary_buffer
Get block of temporary memory (function template )
return_temporary_buffer
Return block of temporary memory (function template )

Specialized algorithms:

uninitialized_copy
Copy block of memory (function template )
uninitialized_copy_n 
Copy block of memory (function template )
uninitialized_fill
Fill block of memory (function template )
uninitialized_fill_n
Fill block of memory (function template )

Memory model

pointer_traits 
Pointer traits (class template )
pointer_safety 
Pointer safety enum (enum class )
declare_reachable 
Declare pointer as reachable (function )
undeclare_reachable 
Undeclare pointer as reachable (function template )
declare_no_pointers 
Declare memory block as containing no pointers (function )
undeclare_no_pointers 
Undeclare memory block as containing no pointers (function )
get_pointer_safety 
Get pointer safety (function )
align 
Align in range (function )
addressof 
Address of object or function (function template )

http://www.cplusplus.com/reference/memory/

<memory>(包括了auto_ptr,shared_ptr等各种指针)的更多相关文章

  1. auto_ptr,shared_ptr 智能指针的使用

    Q: 那个auto_ptr是什么东东啊?为什么没有auto_array?A: 哦,auto_ptr是一个很简单的资源封装类,是在<memory>头文件中定义的.它使用“资源分配即初始化”技 ...

  2. C++智能指针: auto_ptr, shared_ptr, unique_ptr, weak_ptr

    本文参考C++智能指针简单剖析 内存泄露 我们知道一个对象(变量)的生命周期结束的时候, 会自动释放掉其占用的内存(例如局部变量在包含它的第一个括号结束的时候自动释放掉内存) int main () ...

  3. C++11 shared_ptr(智能指针)详解

    要确保用 new 动态分配的内存空间在程序的各条执行路径都能被释放是一件麻烦的事情.C++ 11 模板库的 <memory> 头文件中定义的智能指针,即 shared _ptr 模板,就是 ...

  4. std::shared_ptr 和普通指针的转换

    相互转化见示例 struct test { int num; string name; }; test* pTest = new test(); std::shared_ptr<test> ...

  5. 智能指针auto_ptr & shared_ptr

    转载:智能指针auto_ptr 很多人听说过标准auto_ptr智能指针机制,但并不是每个人都天天使用它.这真是个遗憾,因为auto_ptr优雅地解决了C++设计和编码中常见的问题,正确地使用它可以生 ...

  6. C++ Primer : 第十二章 : 动态内存之shared_ptr类

    在C++中,动态内存是的管理是通过一对运算符来完成的:new  ,在动态内存中为对象分配空间并返回一个指向该对象的指针,delete接受一个动态对象的指针,销毁该对象,并释放该对象关联的内存. 动态内 ...

  7. c++智能指针(unique_ptr 、shared_ptr、weak_ptr、auto_ptr)

    一.前序 什么是智能指针? ——是一个类,用来存储指针(指向动态分配对象也就是堆中对象的的指针). c++的内存管理是让很多人头疼的事,当我们写一个new语句时,一般就会立即把delete语句直接也写 ...

  8. auto_ptr, unique_ptr, shared_ptr and weak_ptr智能指针讲解

    笔者介绍:姜雪伟,IT公司技术合伙人,IT高级讲师,CSDN社区专家,特邀编辑,畅销书作者,已出版书籍:<手把手教你架构3D游戏引擎>电子工业出版社和<Unity3D实战核心技术详解 ...

  9. C++ 智能指针 auto_ptr 和 shared_ptr

    首先,如果你不知道什么是智能指针,请先移步:C++智能指针简单剖析 1.auto_ptr #ifndef AUTO_PTR_H #define AUTO_PTR_H template<typen ...

随机推荐

  1. pip命令使用方法 与 错误处理

    这里把学习到的pip命令写一个汇总,方便想不起来时使用 通过cmd输入pip可以显示提示信息,中文翻译如下: 1)显示某个包的信息 pip show selenium #显示selenium模块的信息 ...

  2. 安装虚拟机(VM)(一)

    原创作品,允许转载,转载时请务必声明作者信息和本声明.  https://www.cnblogs.com/zhu520/p/10728248.html 本人小白,有错指出.谢谢! 一:安装虚拟机前奏 ...

  3. 【Henu ACM Round#18 F】Arthur and Walls

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 考虑,为什么一个连通块里面的空格没有变成一个矩形? 如果不是形成矩形的话. 肯定是因为某个2x2的单张方形里面. 只有一个角是墙.其 ...

  4. Git学习总结(6)——作为一名程序员这些代码托管工具你都知道吗?

    作为一名程序员这些代码托管工具你都知道吗? 作为一名优秀的开发者,大家都会用到代码托管,我本人用的是github,确实github里面有很多很多开源的项目,所以我们目前的创业项目程序员客栈www.pr ...

  5. ArcGIS api for javascript——显示多个ArcGIS Online服务

    描述 本例展示了如何使用按钮在地图里的两个不同的图层间切换.所有地图里的图层恰巧是来自ArcGIS Online的ArcGISTiledMapServiceLayers.按钮是Dojo dijit按钮 ...

  6. C#做的CPU内存使用率

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  7. 数字信号处理C语言集(1.1 随机数的产生)

     main.cpp 所建工程文件如下图所示 uniform.h #ifndef _UNIFORM_H_ #define _UNIFORM_H_ double uniform(double a,doub ...

  8. Android中Gallery和ImageSwitcher同步自动(滚动)播放图片库

    本文主要内容是如何让Gallery和ImageSwitcher控件能够同步自动播放图片集 ,看起来较难,然而,实现的方法非常简单, 请跟我慢慢来.总的来说,本文要实现的效果如下图:(截图效果不怎么好) ...

  9. Python(七) 高级部分:面向对象

    一.类的定义 # 面向对象 #有意义的面向对象代码 # 类 = 面向对象 # 类.对象 #实例化 # 类最基本的作用:封装 class Student(): name = '' age = 0 def ...

  10. C++实现矩阵求逆

    最近实现一个算法要用到求逆等矩阵运算,在网上搜到一个别人写的矩阵类,试了一下效果不错,贴在这里,做个保存. matrix.h文件: #ifndef __MATRIX_H__ #define __MAT ...