Cpp Standard Library 简明教程

C++ Library - <memory>

Introduction

在头文件中定义了一般的实用程序来管理动态内存。

It defines general utilities to manage dynamic memory in header.

Allocators

Sr.No.

Allocator & description

1

allocatorIt is a default allocator.

2

allocator_argIt is an allocator arg.

3

allocator_arg_tIt is a allocator arg type.

4

allocator_traitsIt is an allocator allocator traits.

Managed pointers

Sr.No.

Managed pointers description

1

auto_ptrIt is an automatic Pointer.

2

auto_ptr_refIt is a reference to automatic pointer.

3

shared_ptrIt is a shared pointer.

4

weak_ptrIt is a weak shared pointer.

5

unique_ptrIt is an unique pointer.

6

default_deleteIt is a default deleter.

Sr.No.

Functions and classes related to shared_ptr & description

1

make_sharedIt is used to make shared_ptr.

2

allocate_shared It is used to allocate shared_ptr.

3

static_pointer_castIt is a static cast of shared_ptr.

4

dynamic_pointer_castIt is a dynamic cast of shared_ptr.

5

const_pointer_castIt is a const cast of shared_ptr.

6

get_deleterIt is used to get deleter from shared_ptr.

7

owner_lessIt is a numeric punctuation facet.

8

enable_shared_from_thisIt enables shared_from_this.