当前位置:网站首页>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边栏推荐
- JS tile data lookup leaf node
- Move, say goodbye to the past again
- [learning notes] matroid
- In today's highly integrated chips, most of them are CMOS devices
- AI has surpassed Dr. CS in question making?
- CentOS 6.3 下 PHP编译安装JSON模块报错解决
- A trap used by combinelatest and a debouncetime based solution
- lnx 高效搜索引擎、FastDeploy 推理部署工具箱、AI前沿论文 | ShowMeAI资讯日报 #07.04
- .Net 应用考虑x64生成
- Actual combat | use composite material 3 in application
猜你喜欢

How did the beyond concert 31 years ago get super clean and repaired?

Unity脚本常用API Day03

Data Lake Governance: advantages, challenges and entry

Scientific research cartoon | what else to do after connecting with the subjects?

Move, say goodbye to the past again

What should ABAP do when it calls a third-party API and encounters garbled code?

这几年爆火的智能物联网(AIoT),到底前景如何?

Audio and video technology development weekly | 252

Book of night sky 53 "stone soup" of Apache open source community

Unity animation day05
随机推荐
error: ‘connect‘ was not declared in this scope connect(timer, SIGNAL(timeout()), this, SLOT(up
Unity脚本介绍 Day01
Hexadecimal form
[flask] ORM one to many relationship
科普达人丨一文看懂阿里云的秘密武器“神龙架构”
Explore mongodb - mongodb compass installation, configuration and usage introduction | mongodb GUI
Unity脚本常用API Day03
Align left and right!
Unity update process_ Principle of unity synergy
Redis sentinel mode realizes one master, two slave and three Sentinels
干货 | fMRI标准报告指南新鲜出炉啦,快来涨知识吧
Stress, anxiety or depression? Correct diagnosis and retreatment
Review of Weibo hot search in 2021 and analysis of hot search in the beginning of the year
PR FAQ: how to set PR vertical screen sequence?
AutoCAD - set color
Function test - knowledge points and common interview questions
LeetCode 58. Length of the last word
Socks agent tools earthworm, ssoks
Implementation of web chat room
A trap used by combinelatest and a debouncetime based solution