当前位置:网站首页>std::shared_ ptr initialization: make_ shared< Foo> () vs shared_ ptr< T> (new Foo) [duplicate]
std::shared_ ptr initialization: make_ shared< Foo> () vs shared_ ptr< T> (new Foo) [duplicate]
2022-07-04 16:10:00 【fyin1314】
problem :
What's the difference between: What's the difference? :
std::shared_ptr<int> p = std::shared_ptr<int>( new int );
and and
std::shared_ptr<int> p = std::make_shared< int >();
??
Which one should I prefer and why? Which one should I like better , Why? ?
PS Pretty sure this must have been answered already, but I can't find a similar question.PS I'm sure this must have been answered , But I can't find a similar problem .
Solution :
Reference resources : https://stackoom.com/en/question/1En3f边栏推荐
- MySQL learning notes - data type (2)
- PR FAQ: how to set PR vertical screen sequence?
- Shell 编程基础
- Move, say goodbye to the past again
- Unity脚本API—Transform 变换
- 165 webmaster online toolbox website source code / hare online tool system v2.2.7 Chinese version
- Socks agent tools earthworm, ssoks
- MySQL learning notes - data type (numeric type)
- MYSQL索引优化
- Unity脚本常用API Day03
猜你喜欢
The new generation of domestic ORM framework sagacity sqltoy-5.1.25 release
What is the future of the booming intelligent Internet of things (aiot) in recent years?
Actual combat | use composite material 3 in application
Unity script lifecycle day02
LNX efficient search engine, fastdeploy reasoning deployment toolbox, AI frontier paper | showmeai information daily # 07.04
MySQL learning notes - data type (2)
AI has surpassed Dr. CS in question making?
AI system content recommendation issue 24
What is the catalog of SAP commerce cloud
每周招聘|高级DBA年薪49+,机会越多,成功越近!
随机推荐
The new generation of domestic ORM framework sagacity sqltoy-5.1.25 release
LeetCode 1184. 公交站间的距离 ---vector顺逆时针
Unity update process_ Principle of unity synergy
[book club issue 13] coding format of video files
基于MAX31865的温度控制系统
Enter the width!
31年前的Beyond演唱会,是如何超清修复的?
Preliminary practice of niuke.com (10)
中国主要城市人均存款出炉,你达标了吗?
Logstash ~ detailed explanation of logstash configuration (logstash.yml)
科研漫画 | 联系到被试后还需要做什么?
MySQL学习笔记——数据类型(数值类型)
What does IOT engineering learn and work for?
[North Asia data recovery] data recovery case of database data loss caused by HP DL380 server RAID disk failure
Working group and domain analysis of Intranet
.Net 应用考虑x64生成
Implementation of web chat room
C implementation defines a set of intermediate SQL statements that can be executed across libraries
Understand Alibaba cloud's secret weapon "dragon architecture" in the article "science popularization talent"
Unity script API - component component