当前位置:网站首页>Smart pointer shared_ PTR and weak_ Difference of PTR
Smart pointer shared_ PTR and weak_ Difference of PTR
2022-07-05 03:26:00 【Alex1_ Code】
weak_ptr To solve the problem shared_ptr The problem of circular quotation , Prevent bidirectional binding
1. share_ptr Example
Schematic diagram
It can be seen that , When ptr_a,ptr_b Release , Did not lead to A,B The construction of class .
2. Right up there Example improvements :
Schematic diagram
At this time, both class objects are destructed , meanwhile ptr_a Of use_count by 2,ptr_b Of use_count by 1
边栏推荐
- How to make OS X read bash_ Profile instead of Profile file - how to make OS X to read bash_ profile not . profile file
- Last words record
- Use UDP to send a JPEG image, and UPD will convert it into the mat format of OpenCV after receiving it
- [105] Baidu brain map - Online mind mapping tool
- SQL performance optimization skills
- Pat class a 1162 postfix expression
- ELFK部署
- Jd.com 2: how to prevent oversold in the deduction process of commodity inventory?
- Dart series: collection of best practices
- Usage scenarios and solutions of ledger sharing
猜你喜欢
ELK日志分析系统
Tiny series rendering tutorial
El select, El option drop-down selection box
Port, domain name, protocol.
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Yyds dry goods inventory intelligent fan based on CC2530 design
Pat grade a 1119 pre- and post order traversals (30 points)
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Kbp206-asemi rectifier bridge kbp206
Asp+access campus network goods trading platform
随机推荐
平台入驻与独立部署优缺点对比
Spark SQL learning bullet 2
ELFK部署
[groovy] groovy environment setup (download groovy | install groovy | configure groovy environment variables)
Design and implementation of community hospital information system
Ask, does this ADB MySQL support sqlserver?
In MySQL Association query, the foreign key is null. What if the data cannot be found?
Delphi read / write JSON format
Clean up PHP session files
Is there any way to change the height of the uinavigationbar in the storyboard without using the UINavigationController?
Acwing第 58 场周赛【完结】
Kbp206-asemi rectifier bridge kbp206
SFTP cannot connect to the server # yyds dry goods inventory #
Share the newly released web application development framework based on blazor Technology
[system security] ten thousand words summary system virtualization container bottom layer principle experiment
Idea inheritance relationship
Design and implementation of kindergarten management system
Returns the lowest common ancestor of two nodes in a binary tree
SPI and IIC communication protocol
SQL performance optimization skills