当前位置:网站首页>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
边栏推荐
- Add PRODUCT_BOOT_JARS and classes to provide jar packages to applications
- 我的LaTeX入门
- ALSA音频架构 -- aplay播放流程分析
- 论文笔记:BBN: Bilateral-Branch Network with Cumulative Learningfor Long-Tailed Visual Recognition
- CAN/以太网转换器 CAN与以太网互联互通
- -Fill in color-
- 堆排序 和冒泡排序
- 交换机和路由器技术-28-OSPF的NSSA区域
- 论文笔记:Bag of Tricks for Long-Tailed Visual Recognition with Deep Convolutional Neural Networks
- Three 】 【 yolov7 series of actual combat from 0 to build training data sets
猜你喜欢
随机推荐
利用Navicat Premium导出数据库表结构信息至Excel
Switch---Spanning Tree---Three-layer Architecture Summary
form form submission database Chinese becomes a question mark
剑指offer_抽象建模能力
交换机和路由器技术-21-RIP路由协议
Mysql中事件和定时任务
FPGA工程师面试试题集锦121~130
svg-icon的使用方法(svg-sprite-loader插件)
交换机和路由器技术-25-OSPF多区域配置
增加PRODUCT_BOOT_JARS及类 提供jar包给应用
【电商运营】社交媒体营销策略该如何制定?
-填涂颜色-
findViewById返回null的问题
Licking - frog jumping steps
paddlepaddle实现CS_CE Loss且并入PaddleClas
如何缓解压力、拒绝内耗【1】
应用层协议——DNS
How to switch Green Shield encryption to IP-Guard encryption smoothly
Jetson Orin platform 4-16 channel GMSL2/GSML1 camera acquisition kit recommended
洛谷P2245 星际导航