码迷,mamicode.com
首页 >  
搜索关键字:ptr    ( 2121个结果
C++11的enable_shared_from_this
c++11 中的 shared_from_this() 来源于 boost 中的 enable_shared_form_this 类和 shared_from_this() 函数,功能为返回一个当前类的 std::share_ptr,使用方法如下: #include<memory> class Te ...
分类:编程语言   时间:2021-04-26 13:06:17    阅读次数:0
go中panic源码解读
panic源码解读 前言 panic的作用 panic使用场景 看下实现 gopanic gorecover fatalpanic 总结 参考 panic源码解读 前言 本文是在go version go1.13.15 darwin/amd64上进行的 panic的作用 panic能够改变程序的控制 ...
分类:其他好文   时间:2021-04-23 12:23:51    阅读次数:0
复习类的几个基本函数
考个研真的把很多东西都忘光了,,, #include <string_view> #include <iostream> #include <string> #include <algorithm> #include <vector> using namespace std; class Sampl ...
分类:其他好文   时间:2021-04-23 12:18:50    阅读次数:0
Linux系统编程14_信号和进程状态
信号介绍 SIGKILL 9 exit信号,是不会被阻塞的,不能被忽略;杀死进程的终极办法SIGSTOP 停止,并不消灭进程 SIGINT 2 Ctrl + C时OS送给前台进程组中每个进程, 默认处理的时候会调用exit终止程序SIGQUIT 3 默认处理动作是终止进程并且Core DumpSIG ...
分类:系统相关   时间:2021-04-13 12:31:37    阅读次数:0
复杂声明的正确解读(*、()、[])
摘自《C Primer Plus第六版中文版》page484 声明时可使用的符号 符号 含义 * 表示一个指针 () 表示一个函数 [] 表示一个数组 下面时一些较复杂的声明示例: int board[8][8]; //声明一个内含int数组的数组 int **ptr; //声明一个指向指针的指针, ...
分类:其他好文   时间:2021-04-06 14:44:22    阅读次数:0
c .16.链接,比较代码讲解,分治策略与递归
1.链接代码 char* my_strcat(char* dist, const char* src) { if (dist == nullptr || src == nullptr) { return dist; } char* cp = dist; while (*cp != '\0') { + ...
分类:其他好文   时间:2021-04-05 11:42:36    阅读次数:0
leetcode 173. 二叉搜索树迭代器
leetcode 173. 二叉搜索树迭代器:实现一个二叉搜索树迭代器类BSTIterator ,表示一个按中序遍历二叉搜索树(BST)的迭代器。 ...
分类:其他好文   时间:2021-03-30 13:04:24    阅读次数:0
关于task_struct中变量const cpumask_t *cpus_ptr的作用
422 /** 423 * cpumask_and - *dstp = *src1p & *src2p 424 * @dstp: the cpumask result 425 * @src1p: the first input 426 * @src2p: the second input 427 * ...
分类:其他好文   时间:2021-03-30 13:00:57    阅读次数:0
C++内存管理之unique_ptr
一个unique_ptr"拥有“他所指向的对象。与shared_ptr不同,某个时刻只能有一个unique_ptr指向一个给定的对象。当unique_ptr被销毁时,它所指向的对象也被销毁。uniptr_ptr表达的是一种独占的思想。 初始化 #include <iostream> #include ...
分类:编程语言   时间:2021-03-10 13:24:43    阅读次数:0
C++11 shared_ptr(智能指针)详解
要确保用 new 动态分配的内存空间在程序的各条执行路径都能被释放是一件麻烦的事情。C++ 11 模板库的 <memory> 头文件中定义的智能指针,即 shared _ptr 模板,就是用来部分解决这个问题的。只要将 new 运算符返回的指针 p 交给一个 shared_ptr 对象“托管”,就不 ...
分类:编程语言   时间:2021-03-10 13:24:26    阅读次数:0
2121条   上一页 1 2 3 4 ... 213 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!