智能指针 [英] smart pointers

查看:97
本文介绍了智能指针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

智能指针和自动指针之间是否有区别?

他们指的是相同的想法。


-Thanks

Is there a difference between smart pointers and automatic pointers or
they refer to the same idea.

-Thanks

推荐答案

* Mohammad:
* Mohammad:

智能指针与自动指针之间是否有区别?
它们指的是同一个想法。

Is there a difference between smart pointers and automatic pointers or
they refer to the same idea.




你能举个自动指针的例子吗?


-

答:因为它弄乱了人们通常阅读文字的顺序。

问:为什么这么糟糕?

A:Top -posting。

问:usenet和电子邮件中最烦人的事情是什么?



Can you give an example of what you mean by ''automatic pointer''?

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


Alf P. Steinbach写道:
Alf P. Steinbach wrote:
* Mohammad:
* Mohammad:
智能指针与自动指针之间是否存在差异,或者
它们指的是相同的想法。
Is there a difference between smart pointers and automatic pointers or
they refer to the same idea.


你能给出一个wh的例子在你的意思是''自动指针''?


Can you give an example of what you mean by ''automatic pointer''?




这里只是一个猜测:标准模板类叫做auto_ptr,

也许是是自动的地方。来自...


V



Just a guess here: the standard template class is called auto_ptr,
perhaps that''s where the "automatic" comes from...

V




" Victor Bazarov" <五******** @ comAcast.net>在消息中写道

新闻:BC ************** @ newsread1.dllstx09.us.to.ver io.net ...

"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:BC**************@newsread1.dllstx09.us.to.ver io.net...
Alf P. Steinbach写道:
Alf P. Steinbach wrote:
* Mohammad:
* Mohammad:
智能指针和自动
指针之间是否存在差异或者是指相同的想法。
Is there a difference between smart pointers and automatic pointers orthey refer to the same idea.



你能用自动指针给出一个例子吗?


Can you give an example of what you mean by ''automatic pointer''?



这里只是猜测:标准模板类叫做auto_ptr,也许那就是自动的地方。来自...



Just a guess here: the standard template class is called auto_ptr,
perhaps that''s where the "automatic" comes from...




我猜它意味着一个指针在它被销毁时删除托管指针

被销毁,没有允许共享或转让所有权 - 比如

boost :: scoped_ptr。只是一个猜测。


Jonathan



I''d guess it means a pointer which deletes the managed pointer when it
is destroyed, with no sharing or transfer of ownership allowed -- like
boost::scoped_ptr. Just a guess.

Jonathan


这篇关于智能指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆