当前位置:网站首页>Smart Pointer Notes
Smart Pointer Notes
2022-08-11 04:52:00 【Ingsuifon】
shared_pointer
Aliasing
shared_pointer can share ownership with another pointer, but it actually points to a different object.
That is, the owned object and the pointed object are not the same thing.
//aliasing constructortemplate<class Y>shared_ptr(const shared_ptr<Y>& r, element_type* ptr) noexcept;class Foo {public:Foo(int value) : m_data { value} { }int m_data;};auto foo { make_shared< Foo>(42) };auto aliasing { shared_ptr<int> { foo, &foo->m_data } };//aliasing and foo share ownership of the Foo object, but aliasing points to its member variables边栏推荐
- 应用层协议——DNS
- Mysql:设置主键自动增长起始值
- [QNX Hypervisor 2.2用户手册]10.15 vdev timer8254
- Summary of c language fprintf, fscanf, sscanf and sprintf function knowledge points
- -填涂颜色-
- 【ImageNet】数据集1000个类的名称
- 嵌入式分享合集33
- Listen to pull out U disk inserted into the message, U disk drive
- 「转」“搜索”的原理,架构,实现,实践,面试不用再怕了
- c语言fprintf、fscanf、sscanf以及sprintf函数知识要点总结
猜你喜欢
随机推荐
MQ框架应用比较
走出迷宫的最短路径
分层架构&SOA架构
-Fill in color-
关于数据分页显示
剑指offer_抽象建模能力
开发工具篇第七讲:阿里云日志查询与分析
4 模块三:文献阅读与研究方法
2021年网络规划设计师下午案例题
svg-icon的使用方法(svg-sprite-loader插件)
form form submission database Chinese becomes a question mark
视觉任务种常用的类别文件之一json文件
解决多线程调用sql存储过程问题
Kong实现禁止国外IP访问
Kong implements ban on foreign IP access
FPGA工程师面试试题集锦121~130
优化是一种习惯●出发点是“站在靠近临界“的地方
How to switch Green Shield encryption to IP-Guard encryption smoothly
监听U盘插入 拔出 消息,获得U盘盘符
send_sig: 内核执行流程









